2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
5 * Portable standins for getuid() and friends. See wvuid.h.
7 #include "wvautoconf.h"
13 WvString
wv_username_from_uid(wvuid_t uid
)
15 // FIXME not implemented
16 return WvString::null
;
20 wvuid_t
wv_uid_from_username(WvString username
)
22 // FIXME not implemented
29 // FIXME not implemented
37 WvString
wv_username_from_uid(wvuid_t uid
)
40 struct passwd pwbuf
, *userinfo
;
42 if (getpwuid_r(uid
, &pwbuf
, buf
, sizeof(buf
), &userinfo
) == 0)
43 return userinfo
->pw_name
;
45 return WvString::null
;
49 wvuid_t
wv_uid_from_username(WvString username
)
52 struct passwd pwbuf
, *userinfo
;
54 if (getpwnam_r(username
, &pwbuf
, buf
, sizeof(buf
), &userinfo
) != 0)
55 return userinfo
->pw_uid
;