Re: Connector - how to start?

Evgeniy Polyakov
2006-04-15T11:14:52Z

On Sat, Apr 15, 2006 at 12:50:46PM +0200, Libor Vanek (libor.vanek@gmail.com) wrote:
> Hi

Hello.

> > Why do you want to send big messages over netlink?
> > Netlink is fast but not faster than char device for example, or read
> > from mapped area, although it is much more convenient to use.
> >
> > Well, I can increase CONNECTOR_MAX_MSG_SIZE to maximum allowed 64k, if
> > there is really strong justification.
>
> I need to send messages containing several (1 to 3) file names. And
> "MAXPATHLEN" is 1024b (usually it's much less but I can't rely on
> that).

$ touch `perl -e 'print "A"x1024'`
touch: cannot touch
`AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA':
File name too long

Only 255 is allowed in my system.

> I got working solution using procfs but my (diploma thesis) project
> manager want's me to use netlink/connector solution...

Well, it is strong justification, since connector does not use
CONNECTOR_MAX_MSG_SIZE except for checking that message size is less
that this value, but as pointed above, filename can not be that long,
although it can exceed above value when concatenated with directory
names. But in this case it can exceed any other limits, and it can be
impossible to allocate such a big buffer to store the whole path.

So you will need to create some kind of tree strucuture to store your
names there, since it is wrong thing to allocate a buffer to store the
whole path as is. But in this case you do not need to
increase CONNECTOR_MAX_MSG_SIZE.

> Thanks for help,
> Libor Vanek