]> git.saurik.com Git - apple/libc.git/blob - gen/NetBSD/getlastlogx.3.patch
Libc-498.tar.gz
[apple/libc.git] / gen / NetBSD / getlastlogx.3.patch
1 --- getlastlogx.3.orig 2006-01-11 18:20:07.000000000 -0800
2 +++ getlastlogx.3 2006-01-04 18:02:57.000000000 -0800
3 @@ -34,42 +34,33 @@
4 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5 .\" POSSIBILITY OF SUCH DAMAGE.
6 .\"
7 -.Dd August 26, 2003
8 +.Dd Dec 26, 2005
9 .Dt GETLASTLOGX 3
10 .Os
11 .Sh NAME
12 .Nm getlastlogx ,
13 +.Nm getlastlogxbyname ,
14 .Nm getutmp ,
15 .Nm getutmpx ,
16 -.Nm updlastlogx ,
17 -.Nm updwtmpx ,
18 .Nm utmpxname
19 .Nd user accounting database functions
20 -.Sh LIBRARY
21 -.Lb libc
22 .Sh SYNOPSIS
23 .In utmpx.h
24 .Ft struct lastlogx *
25 -.Fn getlastlogx "const char *fname" "uid_t uid" "struct lastlogx *ll"
26 +.Fn getlastlogx "uid_t uid" "struct lastlogx *ll"
27 +.Ft struct lastlogx *
28 +.Fn getlastlogxbyname "const char *name" "struct lastlogx *ll"
29 .Ft void
30 .Fn getutmp "const struct utmpx *ux" "struct utmp *u"
31 .Ft void
32 .Fn getutmpx "const struct utmp *u" "struct utmpx *ux"
33 .Ft int
34 -.Fn updlastlogx "const char *fname" "uid_t uid" "struct lastlogx *ll"
35 -.Ft int
36 -.Fn updwtmpx "const char *file" "const struct utmpx *utx"
37 -.Ft int
38 .Fn utmpxname "const char *fname"
39 .Sh DESCRIPTION
40 The
41 .Fn getlastlogx
42 function looks up the entry for the user with user id
43 .Fa uid
44 -in the
45 -.Xr lastlogx 5
46 -file given by
47 -.Fa fname
48 and returns it in
49 .Fa \&ll .
50 If the provided
51 @@ -81,8 +72,12 @@
52 and should be
53 .Fn free Ns d
54 by the caller.
55 -.Pp
56 The
57 +.Fn getlastlogxbyname
58 +function is similar to
59 +.Fn getlastlogx ,
60 +except the user name is passed.
61 +.Pp
62 .Fn getutmp
63 function fills out the entries in the struct utmp
64 .Fa u
65 @@ -99,16 +94,6 @@
66 field, which will be initialized to
67 .Dv USER_PROCESS .
68 .Pp
69 -The
70 -.Fn updlastlogx
71 -function tries to update the information for the user with the user id
72 -.Fa uid
73 -in the
74 -.Xr lastlogx 5
75 -file given by
76 -.Fa fname
77 -with the data supplied in
78 -.Fa \&ll .
79 A
80 .Ft struct lastlogx
81 is defined like this:
82 @@ -117,21 +102,8 @@
83 struct timeval ll_tv; /* time entry was created */
84 char ll_line[_UTX_LINESIZE]; /* tty name */
85 char ll_host[_UTX_HOSTSIZE]; /* host name */
86 - struct sockaddr_storage ll_ss; /* address where entry was made from */
87 };
88 .Ed
89 -All the fields should be filled out by the caller.
90 -.Pp
91 -The
92 -.Fn updwtmpx
93 -function updates the
94 -.Xr wtmpx 5
95 -file
96 -.Fa file
97 -with the
98 -.Xr utmpx 5
99 -entry
100 -.Fa utx .
101 .Pp
102 The
103 .Fn utmpxname
104 @@ -141,11 +113,15 @@
105 .Fa fname .
106 .Sh RETURN VALUES
107 .Fn getlastlogx
108 -returns the found entry on success, or
109 +and
110 +.Fn getlastlogxbyname
111 +return the found entry on success, or
112 .Dv NULL
113 if it could not open the database, could not find an entry matching
114 .Fa uid
115 -in there, or could not allocate the necessary space (in case
116 +or
117 +.Fa name ,
118 +or could not allocate the necessary space (in case
119 .Fa \&ll
120 was
121 .Dv NULL ) .
122 @@ -154,27 +130,17 @@
123 returns 1 on success, or 0 if the supplied file name was too long or
124 did not end with
125 .Sq x .
126 -.Pp
127 -.Fn updlastlogx
128 -and
129 -.Fn updwtmpx
130 -return 0 on success, or \-1 in case the database or file respectively
131 -could not be opened or the data not written into it.
132 .Sh SEE ALSO
133 .Xr endutxent 3 ,
134 -.Xr loginx 3 ,
135 .Xr utmpx 5
136 .Sh HISTORY
137 The functions
138 .Fn getutmp ,
139 .Fn getutmpx ,
140 -.Fn updwtmpx ,
141 and
142 .Fn utmpxname
143 first appeared in
144 .Tn Solaris .
145 .Nm getlastlogx
146 -and
147 -.Nm updlastlogx
148 first appeared in
149 .Nx 2.0 .