1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:38:12 +00:00

LibCore: Allow the setgroups wrapper to be used on Lagom

i.e. move Core::System::setgroups() outside the `__serenity__` define.
The base function is already used by LibCore::Account.
This commit is contained in:
Lucas CHOLLET 2022-07-09 14:49:49 +02:00 committed by Sam Atkins
parent 42518867d7
commit 08dcc40aa5
2 changed files with 8 additions and 8 deletions

View file

@ -122,13 +122,6 @@ ErrorOr<void> ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destinati
HANDLE_SYSCALL_RETURN_VALUE("ptrace_peekbuf", rc, {});
}
ErrorOr<void> setgroups(Span<gid_t const> gids)
{
if (::setgroups(gids.size(), gids.data()) < 0)
return Error::from_syscall("setgroups"sv, -errno);
return {};
}
ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int flags)
{
if (target.is_null() || fs_type.is_null())
@ -1217,6 +1210,13 @@ ErrorOr<Vector<gid_t>> getgroups()
return groups;
}
ErrorOr<void> setgroups(Span<gid_t const> gids)
{
if (::setgroups(gids.size(), gids.data()) < 0)
return Error::from_syscall("setgroups"sv, -errno);
return {};
}
ErrorOr<void> mknod(StringView pathname, mode_t mode, dev_t dev)
{
if (pathname.is_null())