]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/Extras/libg/gtruid.c
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / Extras / libg / gtruid.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 /* break up uid into effective and real */
9 /* more compatible with 16-bit uid's */
10 /* getuid and setuid are std. bell routines */
11 geteuid()
12 {
13 return((getuid()>>8)&0377);
14 }
15 getruid()
16 {
17 return(getuid()&0377);
18 }
19 seteuid(euid)
20 {
21 return(setuid(euid<<8|getuid()&0377));
22 }
23 setruid(ruid)
24 {
25 return(setuid(ruid&0377|getuid()&0177600));
26 }