Mike Meyer mwm at
Thu Dec 16 18:02:13 PST 2004

I am, for perverse reasons, writing my own version of getpwuid_r on
5-STABLE. The real source to this lives in
/usr/src/lib/libc/gen/getpwent.c There, the code looks values up in a
db database using a key that consists of a magic cookie prepended to
the userid. The magic cookie is built from a constant in pwd.h and the
version member of a files_state struct. The files_state struct is
presumably filled in by a call to files_getstate.

I can't find the source to files_getstate *anywhere* in /usr/src.


guru% pwd
guru% find . -type f | xargs grep files_getstate /dev/null
./lib/libc/gen/getgrent.c:	rv = files_getstate(&st);
./lib/libc/gen/getgrent.c:	*errnop = files_getstate(&st);
./lib/libc/gen/getpwent.c:	rv = files_getstate(&st);
./lib/libc/gen/getpwent.c:	*errnop = files_getstate(&st);

For that matter, the files_state structure is declared in getpwent.c.

Since I can't figure out what value the version member has, I'm sort
of stuck

Can anyone tell me where to find this missing function/macro?

Mike Meyer <mwm at>
Independent Network/Unix/Perforce consultant, email for more information.

More information about the freebsd-hackers mailing list