3 ms·
Regarding your twitter question: you can create an anonymous temporary file with no name or backing store since recently (4.x, iirc). You should be able to use
by namibj 7y ago
Regarding your twitter question: you can create an anonymous temporary file with no name or backing store since recently (4.x, iirc). You should be able to use dup(2) and unix sockets to send the descriptor over.
- quelsolaar 7y agoThanks! What i cant work out is if/how dup can be made to be owned by a different process. it needs to be only accessible by that process and should be removed once that process dies. I would like to separate the transfer, of the handle, and the translation of the handle.
- namibj 7y agoYeah, you can use sendmsg(2) with special flags to send a file descriptor over a unix socket or iirc also a pipe. It's very useful with kernel-tls or multi-process web servers, to handle no key at all in the worker thread itself or shard processes by something only known after connection establishment, like the HTTP Host header or tls SNI.