Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 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 *
10
cuserid(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
}