Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 215 Bytes
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
#include "getusername.h"
char *
getusername() {
char *user = 0;
struct passwd *pw = getpwuid(getuid());
if (pw)
user = pw->pw_name;
return user;
}
Jump to Line
Something went wrong with that request. Please try again.