Question about implementation of Unix FD passing

Thiago Macieira thiago at kde.org
Sun Feb 10 09:41:46 PST 2013


On domingo, 10 de fevereiro de 2013 14.34.38, Georg Reinke wrote:
> However, because of the special semantics of out-of-band data on Unix
> sockets, one has to read all data in one operation as remaining data is
> discarded. That means that the buffer for the out-of-band data must big
> enough to hold the greatest number of file descriptors that can be
> possibly transferred, which is 2^32 (according to the spec), in order
> to guarantee that no data is discarded.
> 
> While the actual size probably is much lower because of some kernel
> limit, this behaviour still seems odd to me. So my question is: Is this
> intended or have I misunderstood anything or made wrong assumptions
> anywhere?

It's not possible to query the system to find out how many file descriptors were 
passed. Since the number is most often very small, the reference 
implementation passes a buffer of 1024 entries.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130210/25b408be/attachment.pgp>


More information about the dbus mailing list