serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibIPC: Transfer file descriptors in out of band data on single socket

Open ADKaster opened this issue 2 years ago • 0 comments

Currently, we use two sockets to transfer file descriptors and data in LibIPC for each service and application that needs to pass fds around.

This is the "fd passing socket" concept used for each server in Ladybird.

This pattern is cumbersome and we should be able to pass the sockets in out of band data on the unix sockets.

This needs serenity Kernel changes to match the behavior other Unixes, and userspace changes to adapt the LibIPC socket receive methods to match the 'standard' behavior. Serenity's kernel just queues up sendfd/recvfd pairs on the socket until you decide to fetch them. However, Linux/BSDs require you to pull the fd out of the socket at the same time you're receiving data or the socket is dropped on the floor.

ADKaster avatar Dec 19 '23 16:12 ADKaster