⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setuid.2

📁 操作系统设计与实现源码
💻 2
字号:


SETUID(2)                 Minix Programmer's Manual                  SETUID(2)


NAME
     setuid, setgid - set user or group ID's

SYNOPSIS
     #include <sys/types.h>

     int setuid(uid_t uid)
     int setgid(gid_t gid)

DESCRIPTION
     Setuid sets the real and effective user ID's of the  current  process  to
     uid.   Unprivileged users may only change both user ID's to the real user
     ID; only the super-user may make other changes.  Setgid does the same for
     the real and effective group ID's.

     Minix-vmd allows an unprivileged user to change ID's to the original real
     or  effective  ID  as  they  were  at  the time the process was executed.
     Setgid may also set the group ID's to any of the additional  group  ID's.
     If one of the remembered user ID's was 0 then any user or group ID may be
     chosen.

RETURN VALUE
     Upon successful completion, a value of 0 is returned.  Otherwise, a value
     of -1 is returned and errno is set to indicate the error.

ERRORS

     [EPERM]        The current process is not the  super-user  and  a  change
                    other than one of the allowed changes was attempted.

SEE ALSO
     getuid(2), getgid(2).




















4BSD                               May 9, 1985                               1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -