Implement getlogin(3)
This commit is contained in:
6
fakeid.c
6
fakeid.c
@@ -7,8 +7,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
char *getlogin(void) {
|
||||||
|
return getenv("USER");
|
||||||
|
}
|
||||||
|
|
||||||
int getlogin_r(char *buf, size_t bufsize) {
|
int getlogin_r(char *buf, size_t bufsize) {
|
||||||
strncpy(buf, getenv("USER"), bufsize);
|
strncpy(buf, getlogin(), bufsize);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user