What's the problem?
Posted Oct 28, 2010 11:20 UTC (Thu) by neilbrown
In reply to: What's the problem?
Parent article: Ghosts of Unix Past: a historical search for design patterns
I think passing file descriptors around is potentially very sensible. However I don't think much of the API that buries it deep inside sendmsg for Unix domain sockets.
I imagine that if you already had a pipe between two processes (possible using a named pipe in the filesystem) then one process could:
openat(pipefd, NULL, flags);
and the other process could notice (via a poll() message) and
and they would each get an end of a (optionally bi-directional) pipe.
This pipe would be private to the two, in contrast to the named pipe which is shared by every process that opens it.
If you really wanted to pass a file descriptor, you then 'splice' the file descriptor that you to pass onto the pipe. That gives the other end direct access to your file descriptor.
to post comments)