summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/seteuid.c
blob: a0a63610d50bc1c2326ce728ec83e64c73558b2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <unistd.h>
#include <stdio.h>
#include <errno.h>

int seteuid(uid_t uid)
{
  switch (sizeof (uid_t))
  {
  case 2:
    if (uid == 65535)
    {
      __set_errno(EINVAL);
      return -1;
    }
    break;

  default:
    fprintf (stderr, "Uknown uid_t size and sign\n");
  }

  return setreuid(-1, uid);
}