.\" Copyright 1995 Mark D. Roth (roth@uiuc.edu)
.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" Modified Thu Jul 25 14:43:46 MET DST 1996 by Michael Haardt
.\" <michael@cantor.informatik.rwth-aachen.de>
.\"
-.TH GETUTENT 3 2008-06-29 "" "Linux Programmer's Manual"
+.TH GETUTENT 3 2013-04-19 "" "Linux Programmer's Manual"
.SH NAME
getutent, getutid, getutline, pututline, setutent, endutent,
utmpname \- access utmp file entries
If it cannot find an appropriate slot for \fIut\fP,
.BR pututline ()
will append the new entry to the end of the file.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
.BR getutent (),
.BR getutid (),
and
.BR utmpname ()
returns 0 if the new name was successfully stored, or \-1 on failure.
+
+In the event of an error, these functions
+.I errno
+set to indicate the cause.
.SH ERRORS
.TP
.B ENOMEM
.BR setutent (),
.BR pututline (),
and the
-.B getut* ()
+.BR getut* ()
functions can also fail for the reasons described in
.BR open (2).
.SH FILES
/var/run/utmp database of currently logged-in users
.br
/var/log/wtmp database of past user logins
-.SH "CONFORMING TO"
+.SH CONFORMING TO
XPG2, SVr4.
.LP
In XPG2 and SVID 2 the function
.LP
Linux glibc on the other hand does not use a parallel \fIutmpx\fP file
since its \fIutmp\fP structure is already large enough.
-The functions \fBgetutxent\fP()
-etc. are aliases for \fBgetutent\fP() etc.
+The "x" functions listed above are just aliases for
+their counterparts without the "x" (e.g.,
+.BR getutxent ()
+is an alias for
+.BR getutent ()).
.SH NOTES
-.SS Glibc Notes
+.SS Glibc notes
The above functions are not thread-safe.
Glibc adds reentrant versions
.sp
.nf
.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE;
-.R "\& see feature_test_macros(7) */
+.RB "\& see " feature_test_macros "(7) */"
.B #include <utmp.h>
.sp
.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp );
argument gives these functions a place to store their result.
On success they return 0, and a pointer to the result is written in
.IR *ubufp .
-On error these functions return \-1.
+On error, these functions return \-1.
There are no utmpx equivalents of the above functions.
(POSIX.1 does not specify such functions.)
.SH EXAMPLE
exit(EXIT_SUCCESS);
}
.fi
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR getutmp (3),
.BR utmp (5)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.