13WvString wv_username_from_uid(wvuid_t uid)
16 return WvString::null;
20wvuid_t wv_uid_from_username(
WvString username)
38WvString wv_username_from_uid(wvuid_t uid)
41 struct passwd pwbuf, *userinfo;
43 if (getpwuid_r(uid, &pwbuf, buf,
sizeof(buf), &userinfo) == 0)
44 return userinfo->pw_name;
46 return WvString::null;
50wvuid_t wv_uid_from_username(
WvString username)
53 struct passwd pwbuf, *userinfo;
55 if (getpwnam_r(username, &pwbuf, buf,
sizeof(buf), &userinfo) != 0)
56 return userinfo->pw_uid;
WvString is an implementation of a simple and efficient printable-string class.