minix3/lib/libc/sys/setuid.c

25 lines
398 B
C
Raw Normal View History

2020-02-21 00:59:27 +05:30
#include <sys/cdefs.h>
#include <lib.h>
#include "namespace.h"
#include <string.h>
#include <unistd.h>
int setuid(uid_t usr)
{
message m;
memset(&m, 0, sizeof(m));
m.m_lc_pm_setuid.uid = usr;
return(_syscall(PM_PROC_NR, PM_SETUID, &m));
}
int seteuid(uid_t usr)
{
message m;
memset(&m, 0, sizeof(m));
m.m_lc_pm_setuid.uid = usr;
return(_syscall(PM_PROC_NR, PM_SETEUID, &m));
}