LibCore: Let LocalSocket send and receive messages with SCM_RIGHTS

These new methods combine send/receive with send_fd/receive_fd.

This is the 'correct' way to use SCM_RIGHTS, rather than trying to
emulate the Serenity behavior on other Unixes.
This commit is contained in:
Andrew Kaster
2024-04-17 16:40:57 -06:00
committed by Tim Flynn
parent 0e699743c4
commit a18c7c4405
2 changed files with 73 additions and 0 deletions

View File

@@ -329,6 +329,10 @@ public:
ErrorOr<int> receive_fd(int flags);
ErrorOr<void> send_fd(int fd);
ErrorOr<Bytes> receive_message(Bytes buffer, int flags, Vector<int>& fds);
ErrorOr<ssize_t> send_message(ReadonlyBytes msg, int flags, Vector<int, 1> fds = {});
ErrorOr<pid_t> peer_pid() const;
ErrorOr<Bytes> read_without_waiting(Bytes buffer);