diff options
Diffstat (limited to 'usr/src/man/man3c/getutent.3c')
-rw-r--r-- | usr/src/man/man3c/getutent.3c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/usr/src/man/man3c/getutent.3c b/usr/src/man/man3c/getutent.3c index 7ca4d19939..76b25cec9c 100644 --- a/usr/src/man/man3c/getutent.3c +++ b/usr/src/man/man3c/getutent.3c @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH GETUTENT 3C "Oct 27, 1998" +.TH GETUTENT 3C "April 9, 2016" .SH NAME getutent, getutid, getutline, pututline, setutent, endutent, utmpname \- user accounting database functions @@ -46,7 +46,6 @@ accounting database functions .fi .SH DESCRIPTION -.sp .LP These functions provide access to the user accounting database, \fButmp\fR. Entries in the database are described by the definitions and data structures in @@ -81,13 +80,11 @@ short e_exit; /* exit status */ .in -2 .SS "\fBgetutent()\fR" -.sp .LP The \fBgetutent()\fR function reads in the next entry from a \fButmp\fR database. If the database is not already open, it opens it. If it reaches the end of the database, it fails. .SS "\fBgetutid()\fR" -.sp .LP The \fBgetutid()\fR function searches forward from the current point in the \fButmp\fR database until it finds an entry with a \fBut_type\fR matching @@ -99,20 +96,18 @@ pointer to the first entry whose type is one of these four and whose \fBut_id\fR member matches \fIid\fR->\fBut_id\fR. If the end of database is reached without a match, it fails. .SS "\fBgetutline()\fR" -.sp .LP The \fBgetutline()\fR function searches forward from the current point in the \fButmp\fR database until it finds an entry of the type \fBLOGIN_PROCESS\fR or \fBut_line\fR string matching the \fIline\fR->\fBut_line\fR string. If the end of database is reached without a match, it fails. .SS "\fBpututline()\fR" -.sp .LP The \fBpututline()\fR function writes the supplied \fButmp\fR structure into the \fButmp\fR database. It uses \fBgetutid()\fR to search forward for the proper place if it finds that it is not already at the proper place. It is expected that normally the user of \fBpututline()\fR will have searched for the -proper entry using one of the these functions. If so, \fBpututline()\fR will +proper entry using one of these functions. If so, \fBpututline()\fR will not search. If \fBpututline()\fR does not find a matching slot for the new entry, it will add a new entry to the end of the database. It returns a pointer to the \fButmp\fR structure. When called by a non-root user, @@ -123,17 +118,14 @@ associated with the process; the \fBut_type\fR member must be either \fBUSER_PROCESS\fR or \fBDEAD_PROCESS\fR; and the \fBut_line\fR member must be a device special file and be writable by the user. .SS "\fBsetutent()\fR" -.sp .LP The \fBsetutent()\fR function resets the input stream to the beginning. This reset should be done before each search for a new entry if it is desired that the entire database be examined. .SS "\fBendutent()\fR" -.sp .LP The \fBendutent()\fR function closes the currently open database. .SS "\fButmpname()\fR" -.sp .LP The \fButmpname()\fR function allows the user to change the name of the database file examined to another file. If the file does not exist, this will @@ -141,14 +133,12 @@ not be apparent until the first attempt to reference the file is made. The \fButmpname()\fR function does not open the file but closes the old file if it is currently open and saves the new file name. .SH RETURN VALUES -.sp .LP A null pointer is returned upon failure to read, whether for permissions or having reached the end of file, or upon failure to write. If the file name given is longer than 79 characters, \fButmpname()\fR returns \fB0\fR. Otherwise, it returns \fB1\fR. .SH USAGE -.sp .LP These functions use buffered standard I/O for input, but \fBpututline()\fR uses an unbuffered non-standard write to avoid race conditions between processes @@ -162,7 +152,6 @@ to fail if user accounting data cannot be represented properly in the \fButmp\fR structure (for example, on a system where PIDs can exceed 32767). Use the functions described on the \fBgetutxent\fR(3C) manual page instead. .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -178,11 +167,9 @@ MT-Level Unsafe .TE .SH SEE ALSO -.sp .LP \fBgetutxent\fR(3C), \fBttyslot\fR(3C), \fButmpx\fR(4), \fBattributes\fR(5) .SH NOTES -.sp .LP The most current entry is saved in a static structure. Multiple accesses require that it be copied before further accesses are made. On each call to |