LibCore: Implement System::set_close_on_exec

This commit is contained in:
stasoid 2025-02-13 18:50:23 +05:00 committed by Andrew Kaster
commit 2abc792938
Notes: github-actions[bot] 2025-03-20 02:26:29 +00:00
8 changed files with 31 additions and 35 deletions

View file

@ -63,7 +63,13 @@ public:
return exchange(m_fd, -1);
}
ErrorOr<void> clear_close_on_exec();
// FIXME: IPC::Files transferred over the wire are always set O_CLOEXEC during decoding.
// Perhaps we should add an option to IPC::File to allow the receiver to decide whether to
// make it O_CLOEXEC or not. Or an attribute in the .ipc file?
ErrorOr<void> clear_close_on_exec()
{
return Core::System::set_close_on_exec(m_fd, false);
}
private:
explicit File(int fd)