-#ifdef THIS_ONE_IS_UNUSED
-/* This one doesn't use static buffers */
-int getpw(uid_t uid, char *buf)
-{
- struct passwd resultbuf;
- struct passwd *result;
- char buffer[PWD_BUFFER_SIZE];
-
- if (!buf) {
- errno = EINVAL;
- return -1;
- }
-
- if (!getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result)) {
- if (sprintf(buf, "%s:%s:%lu:%lu:%s:%s:%s\n",
- resultbuf.pw_name, resultbuf.pw_passwd,
- (unsigned long)(resultbuf.pw_uid),
- (unsigned long)(resultbuf.pw_gid),
- resultbuf.pw_gecos, resultbuf.pw_dir,
- resultbuf.pw_shell) >= 0
- ) {
- return 0;
- }
- }
-
- return -1;
-}
-#endif
-