Next: Time, Previous: File System, Up: POSIX
The facilities in this section provide an interface to the user and group database. They should be used with care since they are not reentrant.
The following functions accept an object representing user information and return a selected component:
passwd:namepasswd:passwdpasswd:uidpasswd:gidpasswd:gecospasswd:dirpasswd:shellInitialize a stream used by
getpwentto read from the user database. The next use ofgetpwentreturns the first entry. The return value is unspecified.
Return the next entry in the user database, using the stream set by
setpwent.
If called with a true argument, initialize or reset the password data stream. Otherwise, close the stream. The
setpwentandendpwentprocedures are implemented on top of this.
Look up an entry in the user database. obj can be an integer, a string, or omitted, giving the behaviour of getpwuid(3), getpwnam(3) or getpwent(3) respectively.
The following functions accept an object representing group information and return a selected component:
group:namegroup:passwdgroup:gidgroup:memInitialize a stream used by
getgrentto read from the group database. The next use ofgetgrentreturns the first entry. The return value is unspecified.
Return the next entry in the group database, using the stream set by
setgrent.
If called with a true argument, initialize or reset the group data stream. Otherwise, close the stream. The
setgrentandendgrentprocedures are implemented on top of this.
Look up an entry in the group database. obj can be an integer, a string, or omitted, giving the behaviour of getgrgid(3), getgrnam(3) or getgrent(3) respectively.
Note: Guile provides neither cuserid nor getlogin
primarily because the manpage for these functions warns against
using the former (use (getpwuid (geteuid)) instead),
and says the latter can be easily fooled.