3 ms·
Thanks! 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
by quelsolaar 7y ago
Thanks! 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.