1 #include <unistd.h> 2 #include <stdio.h> 3 #include <string.h> 4 5 /* 6 * BUG: supposed to be for effective uid, 7 * but plan9 doesn't have that concept 8 */ 9 char * cuserid(char * s)10cuserid(char *s) 11 { 12 char *logname; 13 static char buf[L_cuserid]; 14 15 if((logname = getlogin()) == NULL) 16 return(NULL); 17 if(s == 0) 18 s = buf; 19 strncpy(s, logname, sizeof buf); 20 return(s); 21 } 22