Re:Bus1: a new Linux interprocess communication proposal
by ahoka on Thursday August 18, 2016 @04:48AM
(#12311168)
> You can't pass file descriptors over sockets.
You can:
http://man7.org/tlpi/code/online/dist/sockets/scm_rights_sen...
Re:Bus1: a new Linux interprocess communication proposal
by justin66 on Thursday August 18, 2016 @08:48AM
(#12312061)
Nice. I've used that book and recommend it to people but I've never seen that before. I don't know how I would find it, either, since it doesn't appear to be indexed anywhere.
Re:Bus1: a new Linux interprocess communication proposal
by dozzie on Thursday August 18, 2016 @04:23AM
(#12311058)
> You can't pass file descriptors over sockets.
Good that my code doesn't know this. It would stop working.
> The descriptors and authentication part is key, [...]
If by "authentication" you mean "checking PID/UID/GID", we already have both in unix sockets.
Re:Bus1: a new Linux interprocess communication proposal
by CJefferson on Thursday August 18, 2016 @04:43AM
(#12311150)
How do you pass a file descriptor through a socket? They just take bytes?
If you mean "I send some bytes that describes the file to open, and keep my processes in sync manually", of course you can do that, but true passing would allow a number of cool things.
Re:Bus1: a new Linux interprocess communication proposal
by ahoka on Thursday August 18, 2016 @04:49AM
(#12311173)
By passing it as ancillary data: http://linux.die.net/man/3/cmsg
You can't pass file descriptors over sockets. You can't do RPC over pipes. Anonymous sockets can only be shared with children. Named sockets require write permission and a filesystem. SysV is prone to resource leaks.
Binder has authentication, shared memory, reference counting, weak references, dead object notifications.
The descriptors and authentication part is key, as it allows Android's trusted system_server to open a device or socket for an untrusted process such as an App if it has user permissions. The receiver of a binder request can check the requester's PID/GID and with confidence from the kernel.
Most importantly, I don't think it's healthy to think of POSIX as being done. Some experimentation and discovery of better APIs and better systems should be encouraged.
gah, I'm driving myself crazy; I swear I saw somewhere a diagram of the Taxonomy of Unix IPC Mechanisms, with most of them crossed out and replaced simply with binder, please help me find it!