Subject: Re: Hesiod thoughts
To: Jonathan Stone <jonathan@dsg.stanford.edu>
From: Greg Hudson <ghudson@MIT.EDU>
List: current-users
Date: 10/22/1995 22:48:24
> Lastly, which of POSIX, ANSI C, and X/Open require getpwent()
> friends?  Is it really feasible to deprecate it?

POSIX.1 omits getpwent(), stating in the rationale:

	The getgrent(), setgrent(), endgrent(), getpwent(),
	setpwent(), and endpwent() functions are not included in
	POSIX.1 because they provide a linear database search
	capability that is not generally useful [the getpwuid(),
	getpwnam(), getgrgid(), and getgrnam() functions are provided
	for keyed lookup] and because in certain distributed systems,
	especially those with different authentication domains, it may
	not be possible or desirable to provide an application with
	the ability to browse the system databases indiscriminately.

Certainly, tcsh can't complete on, say, "~ghud" without getpwent().
I think it's reasonable to write programs which use getpwent(), as
long as you're willing to accept that there may be systems where it
only yields a partial list of usernames.