Implement getlogin(3)

main
Clément FRÉVILLE 2 years ago
parent b37c4c5eb7
commit 9d0cae9372

@ -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;
} }

Loading…
Cancel
Save