aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 06:57:44 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-10 18:40:01 +1000
commit9f4e87b2e7c18243341707a2d2df3957105139e5 (patch)
tree95c4168c10a703fd3168d781f040686e4650b4f7 /win32
parent4e52a794ba999c0de0a166ae5e8dac2e67b93964 (diff)
downloadbusybox-w32-9f4e87b2e7c18243341707a2d2df3957105139e5.tar.gz
busybox-w32-9f4e87b2e7c18243341707a2d2df3957105139e5.tar.bz2
busybox-w32-9f4e87b2e7c18243341707a2d2df3957105139e5.zip
win32: add getpwuid()
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 9ce7bc3ff..2b9776175 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -76,3 +76,17 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
76 memcpy(result, localtime(timep), sizeof(struct tm)); 76 memcpy(result, localtime(timep), sizeof(struct tm));
77 return result; 77 return result;
78} 78}
79
80struct passwd *getpwuid(int uid)
81{
82 static char user_name[100];
83 static struct passwd p;
84
85 DWORD len = sizeof(user_name);
86 if (!GetUserName(user_name, &len))
87 return NULL;
88 p.pw_name = user_name;
89 p.pw_gecos = "unknown";
90 p.pw_dir = NULL;
91 return &p;
92}