[Patch] Moving FD passing into the header

Marcel Holtmann marcel at holtmann.org
Wed Jun 16 07:29:36 PDT 2010


Hi Thiago,

> > > > so I changed Unix FD to not be a basic type anymore, and it's not
> > > > anymore part of the message arguments. Instead you add and retrieve
> > > > them specifically, see
> > > > 
> > > > http://lists.freedesktop.org/archives/dbus/2010-April/012509.html
> > > > 
> > > > The API is this:
> > > > 
> > > > dbus_bool_t dbus_message_append_unix_fd       (DBusMessage *message,
> > > > 
> > > >                                                int          fd);
> > > > 
> > > > dbus_bool_t dbus_message_contains_unix_fds    (DBusMessage
> > > > *message); int         dbus_message_get_n_unix_fds
> > > > (DBusMessage *message); int
> > > > dbus_message_get_unix_fd          (DBusMessage *message,
> > > > int          index);
> > > > 
> > > > *Getting* duplicates the handle. It is an error to try to get more
> > > > descriptors than exist in the message.
> > > > 
> > > > I adjusted the two test cases accordingly to use the new API.
> > > 
> > > Are they still part of the signature? How do I differentiate two fds
> > > from one array of fds?
> > 
> > Hey Thiago,
> > 
> > file descriptor *indices* are no longer part of the signature and you
> > can't anymore use dbus_message_append_args, dbus_message_get_args and
> > friends on them.
> > 
> > You append one descriptor after the other and you can read them back in
> > the order you put them in.
> 
> So you what you're saying is that file descriptors aren't arguments to the 
> callback functions.
> 
> I'm not sure I like this approach. Transmarshalling will become just a lot 
> more complex.
> 
> I prefer Lennart's approach.

I have to agree here. Why are we trying to treat file descriptors
differently? I don't see the point in here. I like having them part of
the signature and part of the introspection.

Regards

Marcel




More information about the dbus mailing list