|
|
1.1 ! root 1: .TH GETUID 2 ! 2: .CT 2 proc_man secur ! 3: .SH NAME ! 4: getuid, getgid, geteuid, getegid, getlogname, getpid, getppid, getpgrp, setuid, setgid, setruid, setlogname, setpgrp \(mi get or set ! 5: user, group, or process identity ! 6: .SH SYNOPSIS ! 7: .nf ! 8: .2C ! 9: .B int getuid() ! 10: .PP ! 11: .B int geteuid() ! 12: .PP ! 13: .B int getgid() ! 14: .PP ! 15: .B int getegid() ! 16: .PP ! 17: .B int getlogname(buf) ! 18: .B char *buf; ! 19: .PP ! 20: .B int getpid() ! 21: .PP ! 22: .B int getppid() ! 23: .PP ! 24: .B int getpgrp(pid) ! 25: .B int pid; ! 26: .PP ! 27: .B int setuid(uid) ! 28: .PP ! 29: .B int setgid(gid) ! 30: .PP ! 31: .B int setruid(uid) ! 32: .PP ! 33: .B int setlogname(buf) ! 34: .B char buf[8]; ! 35: .PP ! 36: .B int setpgrp(pid, pgrp) ! 37: .B int pid, pgrp; ! 38: .sp 3 \" to balance columns ! 39: .1C ! 40: .fi ! 41: .SH DESCRIPTION ! 42: .I Getuid ! 43: returns the real userid of the current process, ! 44: .I geteuid ! 45: the effective userid. ! 46: The real userid identifies the person who is logged in, ! 47: rather than the effective userid, which ! 48: determines access permission at the moment. ! 49: It is thus useful to set-userid programs to find out who invoked them. ! 50: .PP ! 51: .I Getgid ! 52: returns the real groupid, ! 53: .I getegid ! 54: the effective groupid. ! 55: .PP ! 56: .I Getlogname ! 57: copies the login name of the current process ! 58: into the buffer pointed to by ! 59: .IR buf , ! 60: which must be at least eight characters long. ! 61: .PP ! 62: .I Getpid ! 63: returns ! 64: the process id of ! 65: the current process, ! 66: .I getppid ! 67: that of its parent process. ! 68: .PP ! 69: .I Getpgrp ! 70: returns the process group id of process ! 71: .IR pid ; ! 72: 0 ! 73: means the current process. ! 74: .PP ! 75: .I Setuid ! 76: .RI ( setgid ) ! 77: sets the effective and real userid (groupid) of the current process to ! 78: .I uid ! 79: .RI ( gid ). ! 80: Both the effective and the real userid (groupid) are set. ! 81: These calls are permitted only if the process is super-user ! 82: or if the argument is the real or effective userid (groupid). ! 83: .PP ! 84: .I Setruid ! 85: sets the real userid only. ! 86: It may only be used by the super-user. ! 87: .PP ! 88: .I Setlogname ! 89: sets the login name ! 90: returned by ! 91: .IR getlogname . ! 92: It may only be used by the super-user. ! 93: .PP ! 94: .I Setpgrp ! 95: sets the process group id of ! 96: process ! 97: .I pid ! 98: to ! 99: .IR pgrp . ! 100: .I Pid ! 101: 0 is the current process. ! 102: Any process may change its own process group; ! 103: only the super-user may change others. ! 104: .SH "SEE ALSO" ! 105: .IR getuid (1), ! 106: .IR getlogin (3) ! 107: .SH DIAGNOSTICS ! 108: .IR getlogname : ! 109: .BR EFAULT ! 110: .br ! 111: .IR setlogname : ! 112: .BR EFAULT , ! 113: .B EPERM ! 114: .br ! 115: .IR setuid , ! 116: .IR setgid , ! 117: .IR setruid , ! 118: .IR setpgrp : ! 119: .B EPERM ! 120: .SH BUGS ! 121: Non-super-user processes ! 122: may also use ! 123: .I setpgrp ! 124: to change the process group of their descendants; ! 125: only certain unsupported shells use this, ! 126: and the facility may vanish presently.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.