diff options
Diffstat (limited to 'src/libnetdata/os/setresgid.c')
-rw-r--r-- | src/libnetdata/os/setresgid.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libnetdata/os/setresgid.c b/src/libnetdata/os/setresgid.c new file mode 100644 index 000000000..e9f1b1860 --- /dev/null +++ b/src/libnetdata/os/setresgid.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "../libnetdata.h" + +int os_setresgid(gid_t gid __maybe_unused, gid_t egid __maybe_unused, gid_t sgid __maybe_unused) { +#if defined(OS_LINUX) || defined(OS_FREEBSD) + return setresgid(gid, egid, sgid); +#endif + +#if defined(OS_MACOS) + return setregid(gid, egid); +#endif + + errno = ENOSYS; + return -1; +} |