summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/os/setresuid.c
blob: 08169029114a6e9edf4c4547d1f649a537b009a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: GPL-3.0-or-later

#include "../libnetdata.h"

int os_setresuid(uid_t uid __maybe_unused, uid_t euid __maybe_unused, uid_t suid __maybe_unused) {
#if defined(OS_LINUX) || defined(OS_FREEBSD)
    return setresuid(uid, euid, suid);
#endif

#if defined(OS_MACOS)
    return setreuid(uid, euid);
#endif

    errno = ENOSYS;
    return -1;
}