Skip to content

File descriptor sending support via new `sendfd:` scheme

Rose Hudson requested to merge rosehuds/kernel:master into master

This MR adds support for sending file descriptors between processes via a new kernel scheme, sendfd:. Processes expecting to receive fds will open sendfd:socket_name with O_CREAT set and read or wait for events on this fd. Processes wanting to send fds will open sendfd:socket_name with O_CREAT clear and simply write the fd as bytes into the socket. The receiving end will then read a syscall::data::ReceivedFd struct (see this MR on syscall) from the socket which contains the new fd number and the PID of the sending process.

I haven't been able to test this yet.

Merge request reports