Sat Jan 23 00:43:43 2016 UTC ()
Update synopses to match u_int/u_long/etc. changes. Do not bump date as
it's not a substantive change.


(dholland)
diff -r1.14 -r1.15 src/lib/libc/net/getifaddrs.3
diff -r1.8 -r1.9 src/lib/libc/string/bm.3
diff -r1.6 -r1.7 src/lib/libkvm/kvm_getlwps.3
diff -r1.8 -r1.9 src/lib/libkvm/kvm_read.3
diff -r1.10 -r1.11 src/lib/libpci/pci.3
diff -r1.21 -r1.22 src/lib/libutil/login_cap.3

cvs diff -r1.14 -r1.15 src/lib/libc/net/getifaddrs.3 (switch to unified diff)

--- src/lib/libc/net/getifaddrs.3 2013/04/07 23:12:36 1.14
+++ src/lib/libc/net/getifaddrs.3 2016/01/23 00:43:42 1.15
@@ -1,197 +1,197 @@ @@ -1,197 +1,197 @@
1.\" $NetBSD: getifaddrs.3,v 1.14 2013/04/07 23:12:36 wiz Exp $ 1.\" $NetBSD: getifaddrs.3,v 1.15 2016/01/23 00:43:42 dholland Exp $
2.\" BSDI getifaddrs.3,v 2.5 2000/02/23 14:51:59 dab Exp 2.\" BSDI getifaddrs.3,v 2.5 2000/02/23 14:51:59 dab Exp
3.\" 3.\"
4.\" Copyright (c) 1995, 1999 4.\" Copyright (c) 1995, 1999
5.\" Berkeley Software Design, Inc. All rights reserved. 5.\" Berkeley Software Design, Inc. All rights reserved.
6.\" 6.\"
7.\" Redistribution and use in source and binary forms, with or without 7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions 8.\" modification, are permitted provided that the following conditions
9.\" are met: 9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright 10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer. 11.\" notice, this list of conditions and the following disclaimer.
12.\" 12.\"
13.\" THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND 13.\" THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE. 23.\" SUCH DAMAGE.
24.Dd April 7, 2013 24.Dd April 7, 2013
25.Dt GETIFADDRS 3 25.Dt GETIFADDRS 3
26.Os 26.Os
27.Sh NAME 27.Sh NAME
28.Nm getifaddrs 28.Nm getifaddrs
29.Nd get interface addresses 29.Nd get interface addresses
30.Sh SYNOPSIS 30.Sh SYNOPSIS
31.In sys/types.h 31.In sys/types.h
32.In sys/socket.h 32.In sys/socket.h
33.In ifaddrs.h 33.In ifaddrs.h
34.Ft int 34.Ft int
35.Fn getifaddrs "struct ifaddrs **ifap" 35.Fn getifaddrs "struct ifaddrs **ifap"
36.Ft void 36.Ft void
37.Fn freeifaddrs "struct ifaddrs *ifp" 37.Fn freeifaddrs "struct ifaddrs *ifp"
38.Sh DESCRIPTION 38.Sh DESCRIPTION
39The 39The
40.Fn getifaddrs 40.Fn getifaddrs
41function stores a reference to a linked list of the network interfaces 41function stores a reference to a linked list of the network interfaces
42on the local machine in the memory referenced by 42on the local machine in the memory referenced by
43.Fa ifap . 43.Fa ifap .
44The list consists of 44The list consists of
45.Nm ifaddrs 45.Nm ifaddrs
46structures, as defined in the include file 46structures, as defined in the include file
47.In ifaddrs.h . 47.In ifaddrs.h .
48The 48The
49.Nm ifaddrs 49.Nm ifaddrs
50structure contains at least the following entries: 50structure contains at least the following entries:
51.Bd -literal 51.Bd -literal
52 struct ifaddrs *ifa_next; /* Pointer to next struct */ 52 struct ifaddrs *ifa_next; /* Pointer to next struct */
53 char *ifa_name; /* Interface name */ 53 char *ifa_name; /* Interface name */
54 u_int ifa_flags; /* Interface flags */ 54 unsigned ifa_flags; /* Interface flags */
55 struct sockaddr *ifa_addr; /* Interface address */ 55 struct sockaddr *ifa_addr; /* Interface address */
56 struct sockaddr *ifa_netmask; /* Interface netmask */ 56 struct sockaddr *ifa_netmask; /* Interface netmask */
57 struct sockaddr *ifa_broadaddr; /* Interface broadcast address */ 57 struct sockaddr *ifa_broadaddr; /* Interface broadcast address */
58 struct sockaddr *ifa_dstaddr; /* P2P interface destination */ 58 struct sockaddr *ifa_dstaddr; /* P2P interface destination */
59 void *ifa_data; /* Address specific data */ 59 void *ifa_data; /* Address specific data */
60.Ed 60.Ed
61.Pp 61.Pp
62The 62The
63.Li ifa_next 63.Li ifa_next
64field contains a pointer to the next structure on the list. 64field contains a pointer to the next structure on the list.
65This field is 65This field is
66.Dv NULL 66.Dv NULL
67in last structure on the list. 67in last structure on the list.
68.Pp 68.Pp
69The 69The
70.Li ifa_name 70.Li ifa_name
71field contains the interface name. 71field contains the interface name.
72.Pp 72.Pp
73The 73The
74.Li ifa_flags 74.Li ifa_flags
75field contains the interface flags, as set by 75field contains the interface flags, as set by
76.Xr ifconfig 8 76.Xr ifconfig 8
77utility. 77utility.
78.Pp 78.Pp
79The 79The
80.Li ifa_addr 80.Li ifa_addr
81field references either the address of the interface or the link level 81field references either the address of the interface or the link level
82address of the interface, if one exists, otherwise it is 82address of the interface, if one exists, otherwise it is
83.Dv NULL . 83.Dv NULL .
84(The 84(The
85.Li sa_family 85.Li sa_family
86field of the 86field of the
87.Li ifa_addr 87.Li ifa_addr
88field should be consulted to determine the format of the 88field should be consulted to determine the format of the
89.Li ifa_addr 89.Li ifa_addr
90address.) 90address.)
91.Pp 91.Pp
92The 92The
93.Li ifa_netmask 93.Li ifa_netmask
94field references the netmask associated with 94field references the netmask associated with
95.Li ifa_addr , 95.Li ifa_addr ,
96if one is set, otherwise it is 96if one is set, otherwise it is
97.Dv NULL . 97.Dv NULL .
98.Pp 98.Pp
99The 99The
100.Li ifa_broadaddr 100.Li ifa_broadaddr
101field, 101field,
102which should only be referenced for non-P2P interfaces, 102which should only be referenced for non-P2P interfaces,
103references the broadcast address associated with 103references the broadcast address associated with
104.Li ifa_addr , 104.Li ifa_addr ,
105if one exists, otherwise it is 105if one exists, otherwise it is
106.Dv NULL . 106.Dv NULL .
107.Pp 107.Pp
108The 108The
109.Li ifa_dstaddr 109.Li ifa_dstaddr
110field references the destination address on a P2P interface, 110field references the destination address on a P2P interface,
111if one exists, otherwise it is 111if one exists, otherwise it is
112.Dv NULL . 112.Dv NULL .
113.Pp 113.Pp
114The 114The
115.Li ifa_data 115.Li ifa_data
116field references address family specific data. 116field references address family specific data.
117For 117For
118.Dv AF_LINK 118.Dv AF_LINK
119addresses it contains a pointer to the 119addresses it contains a pointer to the
120.Fa struct if_data 120.Fa struct if_data
121.Pq as defined in include file Aq Pa net/if.h 121.Pq as defined in include file Aq Pa net/if.h
122which contains various interface attributes and statistics. 122which contains various interface attributes and statistics.
123For all other address families, it is 123For all other address families, it is
124.Dv NULL . 124.Dv NULL .
125.Pp 125.Pp
126The data returned by 126The data returned by
127.Fn getifaddrs 127.Fn getifaddrs
128is dynamically allocated and should be freed using 128is dynamically allocated and should be freed using
129.Fn freeifaddrs 129.Fn freeifaddrs
130when no longer needed. 130when no longer needed.
131.Sh RETURN VALUES 131.Sh RETURN VALUES
132Upon successful completion, a value of 0 is returned. 132Upon successful completion, a value of 0 is returned.
133Otherwise, a value of -1 is returned and 133Otherwise, a value of -1 is returned and
134.Va errno 134.Va errno
135is set to indicate the error. 135is set to indicate the error.
136.Sh EXAMPLES 136.Sh EXAMPLES
137The following example program prints a list of all addresses configured 137The following example program prints a list of all addresses configured
138on the system. 138on the system.
139.Bd -literal -offset indent 139.Bd -literal -offset indent
140#include \*[Lt]sys/types.h\*[Gt] 140#include \*[Lt]sys/types.h\*[Gt]
141#include \*[Lt]sys/socket.h\*[Gt] 141#include \*[Lt]sys/socket.h\*[Gt]
142#include \*[Lt]stdio.h\*[Gt] 142#include \*[Lt]stdio.h\*[Gt]
143#include \*[Lt]ifaddrs.h\*[Gt] 143#include \*[Lt]ifaddrs.h\*[Gt]
144#include \*[Lt]util.h\*[Gt] 144#include \*[Lt]util.h\*[Gt]
145#include \*[Lt]err.h\*[Gt] 145#include \*[Lt]err.h\*[Gt]
146#include \*[Lt]stdlib.h\*[Gt] 146#include \*[Lt]stdlib.h\*[Gt]
147 147
148int 148int
149main(int argc, char *argv[]) 149main(int argc, char *argv[])
150{ 150{
151 struct ifaddrs *ifa, *a; 151 struct ifaddrs *ifa, *a;
152 152
153 if (getifaddrs(\*[Am]ifa) == -1) 153 if (getifaddrs(\*[Am]ifa) == -1)
154 err(EXIT_FAILURE, "getifaddrs"); 154 err(EXIT_FAILURE, "getifaddrs");
155 155
156 for (a = ifa; a; a = a->ifa_next) { 156 for (a = ifa; a; a = a->ifa_next) {
157 char buf[1024]; 157 char buf[1024];
158 sockaddr_snprintf(buf, sizeof(buf), "%f %a", 158 sockaddr_snprintf(buf, sizeof(buf), "%f %a",
159 a->ifa_addr); 159 a->ifa_addr);
160 printf("%s %x %s\\n", a->ifa_name, a->ifa_flags, buf); 160 printf("%s %x %s\\n", a->ifa_name, a->ifa_flags, buf);
161 } 161 }
162 freeifaddrs(ifa); 162 freeifaddrs(ifa);
163 return EXIT_SUCCESS; 163 return EXIT_SUCCESS;
164} 164}
165.Ed 165.Ed
166.Sh ERRORS 166.Sh ERRORS
167The 167The
168.Fn getifaddrs 168.Fn getifaddrs
169may fail and set 169may fail and set
170.Va errno 170.Va errno
171for any of the errors specified for the library routines 171for any of the errors specified for the library routines
172.Xr ioctl 2 , 172.Xr ioctl 2 ,
173.Xr socket 2 , 173.Xr socket 2 ,
174.Xr malloc 3 174.Xr malloc 3
175or 175or
176.Xr sysctl 3 . 176.Xr sysctl 3 .
177.Sh SEE ALSO 177.Sh SEE ALSO
178.Xr ioctl 2 , 178.Xr ioctl 2 ,
179.Xr socket 2 , 179.Xr socket 2 ,
180.Xr sysctl 3 , 180.Xr sysctl 3 ,
181.Xr networking 4 , 181.Xr networking 4 ,
182.Xr ifconfig 8 182.Xr ifconfig 8
183.Sh HISTORY 183.Sh HISTORY
184The 184The
185.Nm 185.Nm
186implementation first appeared in 186implementation first appeared in
187.Bsx . 187.Bsx .
188.Sh BUGS 188.Sh BUGS
189If both 189If both
190.In net/if.h 190.In net/if.h
191and 191and
192.In ifaddrs.h 192.In ifaddrs.h
193are being included, 193are being included,
194.In net/if.h 194.In net/if.h
195.Em must 195.Em must
196be included before 196be included before
197.In ifaddrs.h . 197.In ifaddrs.h .

cvs diff -r1.8 -r1.9 src/lib/libc/string/bm.3 (switch to unified diff)

--- src/lib/libc/string/bm.3 2006/10/16 08:48:45 1.8
+++ src/lib/libc/string/bm.3 2016/01/23 00:43:42 1.9
@@ -1,114 +1,114 @@ @@ -1,114 +1,114 @@
1.\" $NetBSD: bm.3,v 1.8 2006/10/16 08:48:45 wiz Exp $ 1.\" $NetBSD: bm.3,v 1.9 2016/01/23 00:43:42 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1994 3.\" Copyright (c) 1994
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to Berkeley by 6.\" This code is derived from software contributed to Berkeley by
7.\" Andrew Hume of AT&T Bell Laboratories. 7.\" Andrew Hume of AT&T Bell Laboratories.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the 15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution. 16.\" documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors 17.\" 3. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software 18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission. 19.\" without specific prior written permission.
20.\" 20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" from: @(#)bm.3 8.4 (Berkeley) 6/21/94 33.\" from: @(#)bm.3 8.4 (Berkeley) 6/21/94
34.\" 34.\"
35.Dd April 8, 2001 35.Dd April 8, 2001
36.Dt BM 3 36.Dt BM 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm bm_comp , 39.Nm bm_comp ,
40.Nm bm_exec , 40.Nm bm_exec ,
41.Nm bm_free 41.Nm bm_free
42.Nd Boyer-Moore string search 42.Nd Boyer-Moore string search
43.Sh LIBRARY 43.Sh LIBRARY
44.Lb libc 44.Lb libc
45.Sh SYNOPSIS 45.Sh SYNOPSIS
46.In sys/types.h 46.In sys/types.h
47.In bm.h 47.In bm.h
48.Ft bm_pat * 48.Ft bm_pat *
49.Fn bm_comp "u_char *pattern" "size_t patlen" "u_char freq[256]" 49.Fn bm_comp "unsigned char *pattern" "size_t patlen" "unsigned char freq[256]"
50.Ft u_char * 50.Ft unsigned char *
51.Fn bm_exec "bm_pat *pdesc" "u_char *text" "size_t len" 51.Fn bm_exec "bm_pat *pdesc" "unsigned char *text" "size_t len"
52.Ft void 52.Ft void
53.Fn bm_free "bm_pat *pdesc" 53.Fn bm_free "bm_pat *pdesc"
54.Sh DESCRIPTION 54.Sh DESCRIPTION
55These routines implement an efficient mechanism to find an 55These routines implement an efficient mechanism to find an
56occurrence of a byte string within another byte string. 56occurrence of a byte string within another byte string.
57.Pp 57.Pp
58.Fn bm_comp 58.Fn bm_comp
59evaluates the 59evaluates the
60.Fa patlen 60.Fa patlen
61bytes starting at 61bytes starting at
62.Fa pattern , 62.Fa pattern ,
63and returns a pointer to a structure describing them. 63and returns a pointer to a structure describing them.
64The bytes referenced by 64The bytes referenced by
65.Fa pattern 65.Fa pattern
66may be of any value. 66may be of any value.
67.Pp 67.Pp
68The search takes advantage of the frequency distribution of the 68The search takes advantage of the frequency distribution of the
69bytes in the text to be searched. 69bytes in the text to be searched.
70If specified, 70If specified,
71.Fa freq 71.Fa freq
72should be an array of 256 values, 72should be an array of 256 values,
73with higher values indicating that the corresponding character occurs 73with higher values indicating that the corresponding character occurs
74more frequently. 74more frequently.
75(A less than optimal frequency distribution can only result in less 75(A less than optimal frequency distribution can only result in less
76than optimal performance, not incorrect results.) 76than optimal performance, not incorrect results.)
77If 77If
78.Fa freq 78.Fa freq
79is 79is
80.Dv NULL , 80.Dv NULL ,
81a system default table is used. 81a system default table is used.
82.Pp 82.Pp
83.Fn bm_exec 83.Fn bm_exec
84returns a pointer to the leftmost occurrence of the string given to 84returns a pointer to the leftmost occurrence of the string given to
85.Fn bm_comp 85.Fn bm_comp
86within 86within
87.Fa text , 87.Fa text ,
88or 88or
89.Dv NULL 89.Dv NULL
90if none occurs. 90if none occurs.
91The number of bytes in 91The number of bytes in
92.Fa text 92.Fa text
93must be specified by 93must be specified by
94.Fa len . 94.Fa len .
95.Pp 95.Pp
96Space allocated for the returned description is discarded 96Space allocated for the returned description is discarded
97by calling 97by calling
98.Fn bm_free 98.Fn bm_free
99with the returned description as an argument. 99with the returned description as an argument.
100.Pp 100.Pp
101The asymptotic speed of 101The asymptotic speed of
102.Fn bm_exec 102.Fn bm_exec
103is O(len/patlen). 103is O(len/patlen).
104.Sh SEE ALSO 104.Sh SEE ALSO
105.Xr regexp 3 , 105.Xr regexp 3 ,
106.Xr strstr 3 106.Xr strstr 3
107.Rs 107.Rs
108.%A Hume and Sunday 108.%A Hume and Sunday
109.%D November 1991 109.%D November 1991
110.%J "Software Practice and Experience" 110.%J "Software Practice and Experience"
111.%P pp. 1221-48 111.%P pp. 1221-48
112.%T "Fast String Searching" 112.%T "Fast String Searching"
113.%V Vol. 21, 11 113.%V Vol. 21, 11
114.Re 114.Re

cvs diff -r1.6 -r1.7 src/lib/libkvm/kvm_getlwps.3 (switch to unified diff)

--- src/lib/libkvm/kvm_getlwps.3 2009/03/10 23:49:07 1.6
+++ src/lib/libkvm/kvm_getlwps.3 2016/01/23 00:43:43 1.7
@@ -1,102 +1,102 @@ @@ -1,102 +1,102 @@
1.\" $NetBSD: kvm_getlwps.3,v 1.6 2009/03/10 23:49:07 joerg Exp $ 1.\" $NetBSD: kvm_getlwps.3,v 1.7 2016/01/23 00:43:43 dholland Exp $
2.\" 2.\"
3.\"Copyright (c) 2002 The NetBSD Foundation, Inc. 3.\"Copyright (c) 2002 The NetBSD Foundation, Inc.
4.\"All rights reserved. 4.\"All rights reserved.
5.\" 5.\"
6.\"This code is derived from software contributed to The NetBSD Foundation 6.\"This code is derived from software contributed to The NetBSD Foundation
7.\"by Nathan J. Williams. 7.\"by Nathan J. Williams.
8.\" 8.\"
9.\"Redistribution and use in source and binary forms, with or without 9.\"Redistribution and use in source and binary forms, with or without
10.\"modification, are permitted provided that the following conditions 10.\"modification, are permitted provided that the following conditions
11.\"are met: 11.\"are met:
12.\"1. Redistributions of source code must retain the above copyright 12.\"1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\"2. Redistributions in binary form must reproduce the above copyright 14.\"2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the 15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution. 16.\" documentation and/or other materials provided with the distribution.
17.\" 17.\"
18.\"THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\"THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\"TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\"TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\"PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\"PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\"BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\"BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\"POSSIBILITY OF SUCH DAMAGE. 28.\"POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd February 10, 2004 30.Dd February 10, 2004
31.Dt KVM_GETLWPS 3 31.Dt KVM_GETLWPS 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm kvm_getlwps 34.Nm kvm_getlwps
35.Nd access state of LWPs belonging to a user process 35.Nd access state of LWPs belonging to a user process
36.Sh LIBRARY 36.Sh LIBRARY
37.Lb libkvm 37.Lb libkvm
38.Sh SYNOPSIS 38.Sh SYNOPSIS
39.In kvm.h 39.In kvm.h
40.In sys/param.h 40.In sys/param.h
41.In sys/sysctl.h 41.In sys/sysctl.h
42.\" .Fa kvm_t *kd 42.\" .Fa kvm_t *kd
43.Ft struct kinfo_lwp * 43.Ft struct kinfo_lwp *
44.Fn kvm_getlwps "kvm_t *kd" "int pid" "u_long procaddr" "int *elemsize" "int *cnt" 44.Fn kvm_getlwps "kvm_t *kd" "int pid" "unsigned long procaddr" "int *elemsize" "int *cnt"
45.Sh DESCRIPTION 45.Sh DESCRIPTION
46.Fn kvm_getlwps 46.Fn kvm_getlwps
47returns the set of LWPs belonging to the process specified by 47returns the set of LWPs belonging to the process specified by
48.Fa pid 48.Fa pid
49or 49or
50.Fa procaddr 50.Fa procaddr
51in the kernel indicated by 51in the kernel indicated by
52.Fa kd . 52.Fa kd .
53The number of LWPs found is returned in the reference parameter 53The number of LWPs found is returned in the reference parameter
54.Fa cnt . 54.Fa cnt .
55The LWPs are returned as a contiguous array of 55The LWPs are returned as a contiguous array of
56.Sy kinfo_lwp 56.Sy kinfo_lwp
57structures. 57structures.
58This memory is locally allocated, and subsequent calls to 58This memory is locally allocated, and subsequent calls to
59.Fn kvm_getlwps 59.Fn kvm_getlwps
60and 60and
61.Fn kvm_close 61.Fn kvm_close
62will overwrite this storage. 62will overwrite this storage.
63.Pp 63.Pp
64Only the first 64Only the first
65.Fa elemsize 65.Fa elemsize
66bytes of each array entry are returned. 66bytes of each array entry are returned.
67If the size of the 67If the size of the
68.Sy kinfo_lwp 68.Sy kinfo_lwp
69structure increases in size in a future release of 69structure increases in size in a future release of
70.Nx 70.Nx
71the kernel will only return the requested amount of data for 71the kernel will only return the requested amount of data for
72each array entry and programs that use 72each array entry and programs that use
73.Fn kvm_getlwps 73.Fn kvm_getlwps
74will continue to function without the need for recompilation. 74will continue to function without the need for recompilation.
75.Pp 75.Pp
76If called against an active kernel, the 76If called against an active kernel, the
77.Fn kvm_getlwps 77.Fn kvm_getlwps
78function will use the 78function will use the
79.Xr sysctl 3 79.Xr sysctl 3
80interface and return information about the process identified by 80interface and return information about the process identified by
81.Fa pid ; 81.Fa pid ;
82otherwise the kernel memory device file or swap device will be 82otherwise the kernel memory device file or swap device will be
83accessed and the process is identified by the location passed in 83accessed and the process is identified by the location passed in
84.Fa paddr . 84.Fa paddr .
85.Sh RETURN VALUES 85.Sh RETURN VALUES
86.Fn kvm_getlwps 86.Fn kvm_getlwps
87returns 87returns
88.Dv NULL 88.Dv NULL
89on failure. 89on failure.
90.Sh SEE ALSO 90.Sh SEE ALSO
91.Xr kvm 3 , 91.Xr kvm 3 ,
92.Xr kvm_close 3 , 92.Xr kvm_close 3 ,
93.Xr kvm_geterr 3 , 93.Xr kvm_geterr 3 ,
94.Xr kvm_getproc2 3 , 94.Xr kvm_getproc2 3 ,
95.Xr kvm_getprocs 3 , 95.Xr kvm_getprocs 3 ,
96.Xr kvm_nlist 3 , 96.Xr kvm_nlist 3 ,
97.Xr kvm_open 3 , 97.Xr kvm_open 3 ,
98.Xr kvm_openfiles 3 , 98.Xr kvm_openfiles 3 ,
99.Xr kvm_read 3 , 99.Xr kvm_read 3 ,
100.Xr kvm_write 3 100.Xr kvm_write 3
101.Sh BUGS 101.Sh BUGS
102These routines do not belong in the kvm interface. 102These routines do not belong in the kvm interface.

cvs diff -r1.8 -r1.9 src/lib/libkvm/kvm_read.3 (switch to unified diff)

--- src/lib/libkvm/kvm_read.3 2003/08/07 16:44:39 1.8
+++ src/lib/libkvm/kvm_read.3 2016/01/23 00:43:43 1.9
@@ -1,93 +1,93 @@ @@ -1,93 +1,93 @@
1.\" $NetBSD: kvm_read.3,v 1.8 2003/08/07 16:44:39 agc Exp $ 1.\" $NetBSD: kvm_read.3,v 1.9 2016/01/23 00:43:43 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1992, 1993 3.\" Copyright (c) 1992, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" This code is derived from software developed by the Computer Systems 6.\" This code is derived from software developed by the Computer Systems
7.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract 7.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
8.\" BG 91-66 and contributed to Berkeley. 8.\" BG 91-66 and contributed to Berkeley.
9.\" 9.\"
10.\" Redistribution and use in source and binary forms, with or without 10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions 11.\" modification, are permitted provided that the following conditions
12.\" are met: 12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright 13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer. 14.\" notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in the 16.\" notice, this list of conditions and the following disclaimer in the
17.\" documentation and/or other materials provided with the distribution. 17.\" documentation and/or other materials provided with the distribution.
18.\" 3. Neither the name of the University nor the names of its contributors 18.\" 3. Neither the name of the University nor the names of its contributors
19.\" may be used to endorse or promote products derived from this software 19.\" may be used to endorse or promote products derived from this software
20.\" without specific prior written permission. 20.\" without specific prior written permission.
21.\" 21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
33.\" 33.\"
34.\" @(#)kvm_read.3 8.1 (Berkeley) 6/4/93 34.\" @(#)kvm_read.3 8.1 (Berkeley) 6/4/93
35.\" 35.\"
36.Dd June 4, 1993 36.Dd June 4, 1993
37.Dt KVM_READ 3 37.Dt KVM_READ 3
38.Os 38.Os
39.Sh NAME 39.Sh NAME
40.Nm kvm_read , 40.Nm kvm_read ,
41.Nm kvm_write 41.Nm kvm_write
42.Nd read or write kernel virtual memory 42.Nd read or write kernel virtual memory
43.Sh LIBRARY 43.Sh LIBRARY
44.Lb libkvm 44.Lb libkvm
45.Sh SYNOPSIS 45.Sh SYNOPSIS
46.In kvm.h 46.In kvm.h
47.Ft ssize_t 47.Ft ssize_t
48.Fn kvm_read "kvm_t *kd" "u_long addr" "void *buf" "size_t nbytes" 48.Fn kvm_read "kvm_t *kd" "unsigned long addr" "void *buf" "size_t nbytes"
49.Ft ssize_t 49.Ft ssize_t
50.Fn kvm_write "kvm_t *kd" "u_long addr" "const void *buf" "size_t nbytes" 50.Fn kvm_write "kvm_t *kd" "unsigned long addr" "const void *buf" "size_t nbytes"
51.Sh DESCRIPTION 51.Sh DESCRIPTION
52The 52The
53.Fn kvm_read 53.Fn kvm_read
54and 54and
55.Fn kvm_write 55.Fn kvm_write
56functions are used to read and write kernel virtual memory (or a crash 56functions are used to read and write kernel virtual memory (or a crash
57dump file). 57dump file).
58See 58See
59.Fn kvm_open 3 59.Fn kvm_open 3
60or 60or
61.Fn kvm_openfiles 3 61.Fn kvm_openfiles 3
62for information regarding opening kernel virtual memory and crash dumps. 62for information regarding opening kernel virtual memory and crash dumps.
63.Pp 63.Pp
64The 64The
65.Fn kvm_read 65.Fn kvm_read
66function transfers 66function transfers
67.Fa nbytes 67.Fa nbytes
68bytes of data from 68bytes of data from
69the kernel space address 69the kernel space address
70.Fa addr 70.Fa addr
71to 71to
72.Fa buf . 72.Fa buf .
73Conversely, 73Conversely,
74.Fn kvm_write 74.Fn kvm_write
75transfers data from 75transfers data from
76.Fa buf 76.Fa buf
77to 77to
78.Fa addr . 78.Fa addr .
79Unlike their SunOS counterparts, these functions cannot be used to 79Unlike their SunOS counterparts, these functions cannot be used to
80read or write process address spaces. 80read or write process address spaces.
81.Sh RETURN VALUES 81.Sh RETURN VALUES
82Upon success, the number of bytes actually transferred is returned. 82Upon success, the number of bytes actually transferred is returned.
83Otherwise, -1 is returned. 83Otherwise, -1 is returned.
84.Sh SEE ALSO 84.Sh SEE ALSO
85.Xr kvm 3 , 85.Xr kvm 3 ,
86.Xr kvm_close 3 , 86.Xr kvm_close 3 ,
87.Xr kvm_getargv 3 , 87.Xr kvm_getargv 3 ,
88.Xr kvm_getenvv 3 , 88.Xr kvm_getenvv 3 ,
89.Xr kvm_geterr 3 , 89.Xr kvm_geterr 3 ,
90.Xr kvm_getprocs 3 , 90.Xr kvm_getprocs 3 ,
91.Xr kvm_nlist 3 , 91.Xr kvm_nlist 3 ,
92.Xr kvm_open 3 , 92.Xr kvm_open 3 ,
93.Xr kvm_openfiles 3 93.Xr kvm_openfiles 3

cvs diff -r1.10 -r1.11 src/lib/libpci/pci.3 (switch to unified diff)

--- src/lib/libpci/pci.3 2014/12/16 13:38:36 1.10
+++ src/lib/libpci/pci.3 2016/01/23 00:43:43 1.11
@@ -1,188 +1,188 @@ @@ -1,188 +1,188 @@
1.\" $NetBSD: pci.3,v 1.10 2014/12/16 13:38:36 msaitoh Exp $ 1.\" $NetBSD: pci.3,v 1.11 2016/01/23 00:43:43 dholland Exp $
2.\" 2.\"
3.\" Copyright 2001 Wasabi Systems, Inc. 3.\" Copyright 2001 Wasabi Systems, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Written by Jason R. Thorpe for Wasabi Systems, Inc. 6.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
7.\" 7.\"
8.\" Redistribution and use in source and binary forms, with or without 8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions 9.\" modification, are permitted provided that the following conditions
10.\" are met: 10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright 11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer. 12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution. 15.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software 16.\" 3. All advertising materials mentioning features or use of this software
17.\" must display the following acknowledgement: 17.\" must display the following acknowledgement:
18.\" This product includes software developed for the NetBSD Project by 18.\" This product includes software developed for the NetBSD Project by
19.\" Wasabi Systems, Inc. 19.\" Wasabi Systems, Inc.
20.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse 20.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
21.\" or promote products derived from this software without specific prior 21.\" or promote products derived from this software without specific prior
22.\" written permission. 22.\" written permission.
23.\" 23.\"
24.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 24.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 26.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 27.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
28.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34.\" POSSIBILITY OF SUCH DAMAGE. 34.\" POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.Dd December 16, 2014 36.Dd December 16, 2014
37.Dt PCI 3 37.Dt PCI 3
38.Os 38.Os
39.Sh NAME 39.Sh NAME
40.Nm pci 40.Nm pci
41.Nd library interface for PCI bus access 41.Nd library interface for PCI bus access
42.Sh LIBRARY 42.Sh LIBRARY
43.Lb libpci 43.Lb libpci
44.Sh SYNOPSIS 44.Sh SYNOPSIS
45.In pci.h 45.In pci.h
46.Ft int 46.Ft int
47.Fn pcibus_conf_read "int pcifd" "u_int bus" "u_int dev" "u_int func" \ 47.Fn pcibus_conf_read "int pcifd" "unsigned bus" "unsigned dev" "unsigned func" \
48"u_int reg" "pcireg_t *valp" 48"unsigned reg" "pcireg_t *valp"
49.Ft int 49.Ft int
50.Fn pcibus_conf_write "int pcifd" "u_int bus" "u_int dev" "u_int func" \ 50.Fn pcibus_conf_write "int pcifd" "unsigned bus" "unsigned dev" "unsigned func" \
51"u_int reg" "pcireg_t val" 51"unsigned reg" "pcireg_t val"
52.Ft int 52.Ft int
53.Fn pcidev_conf_read "int devfd" "u_int reg" "pcireg_t *valp" 53.Fn pcidev_conf_read "int devfd" "unsigned reg" "pcireg_t *valp"
54.Ft int 54.Ft int
55.Fn pcidev_conf_write "int devfd" "u_int reg" "pcireg_t val" 55.Fn pcidev_conf_write "int devfd" "unsigned reg" "pcireg_t val"
56.Ft char * 56.Ft char *
57.Fn pci_findvendor "pcireg_t id_reg" 57.Fn pci_findvendor "pcireg_t id_reg"
58.Ft void 58.Ft void
59.Fn pci_devinfo "pcireg_t id_reg" "pcireg_t class_reg" "int showclass" "char *devinfo" "size_t len" 59.Fn pci_devinfo "pcireg_t id_reg" "pcireg_t class_reg" "int showclass" "char *devinfo" "size_t len"
60.Ft void 60.Ft void
61.Fn pci_conf_print "int pcifd" "u_int bus" "u_int dev" "u_int func" 61.Fn pci_conf_print "int pcifd" "unsigned bus" "unsigned dev" "unsigned func"
62.Ft int 62.Ft int
63.Fn pci_drvname "int pcifd" "u_int dev" "u_int func" "char *drvname" "size_t len" 63.Fn pci_drvname "int pcifd" "unsigned dev" "unsigned func" "char *drvname" "size_t len"
64.Sh DESCRIPTION 64.Sh DESCRIPTION
65The 65The
66.Nm 66.Nm
67library provides support for accessing the PCI bus by user programs. 67library provides support for accessing the PCI bus by user programs.
68.Pp 68.Pp
69These functions are available in the 69These functions are available in the
70.Nm libpci 70.Nm libpci
71library. 71library.
72Programs should be linked with 72Programs should be linked with
73.Fl lpci . 73.Fl lpci .
74.Sh CONFIGURATION SPACE FUNCTIONS 74.Sh CONFIGURATION SPACE FUNCTIONS
75The following functions are used to access PCI configuration space: 75The following functions are used to access PCI configuration space:
76.Bl -tag -width 4n 76.Bl -tag -width 4n
77.It Fn pcibus_conf_read 77.It Fn pcibus_conf_read
78Access the PCI configuration register 78Access the PCI configuration register
79.Fa reg 79.Fa reg
80on the device located at 80on the device located at
81.Fa bus , 81.Fa bus ,
82.Fa dev , 82.Fa dev ,
83.Fa func , 83.Fa func ,
84and place the result in 84and place the result in
85.Fa *valp . 85.Fa *valp .
86.Fa pcifd 86.Fa pcifd
87must be an open file descriptor to a PCI bus within the target PCI domain. 87must be an open file descriptor to a PCI bus within the target PCI domain.
88.It Fn pcibus_conf_write 88.It Fn pcibus_conf_write
89Write the value specified by 89Write the value specified by
90.Fa val 90.Fa val
91into the PCI configuration register 91into the PCI configuration register
92.Fa reg 92.Fa reg
93on the device located at 93on the device located at
94.Fa bus , 94.Fa bus ,
95.Fa dev , 95.Fa dev ,
96.Fa func . 96.Fa func .
97.Fa pcifd 97.Fa pcifd
98must be an open file descriptor to a PCI bus within the target PCI domain. 98must be an open file descriptor to a PCI bus within the target PCI domain.
99.It Fn pcidev_conf_read 99.It Fn pcidev_conf_read
100Access the PCI configuration register 100Access the PCI configuration register
101.Fa reg 101.Fa reg
102on the device associated with the open file descriptor 102on the device associated with the open file descriptor
103.Fa devfd 103.Fa devfd
104and place the result in 104and place the result in
105.Fa *valp . 105.Fa *valp .
106.It Fn pcidev_conf_write 106.It Fn pcidev_conf_write
107Write the value specified by 107Write the value specified by
108.Fa val 108.Fa val
109into the PCI configuration register 109into the PCI configuration register
110.Fa reg 110.Fa reg
111on the device associated with the open file descriptor 111on the device associated with the open file descriptor
112.Fa devfd . 112.Fa devfd .
113.El 113.El
114.Sh MISCELLANEOUS FUNCTIONS 114.Sh MISCELLANEOUS FUNCTIONS
115The following miscellaneous functions are available: 115The following miscellaneous functions are available:
116.Bl -tag -width 4n 116.Bl -tag -width 4n
117.It Fn pci_findvendor 117.It Fn pci_findvendor
118Return an ASCII description of the PCI vendor in the 118Return an ASCII description of the PCI vendor in the
119PCI ID register 119PCI ID register
120.Fa id_reg . 120.Fa id_reg .
121.It Fn pci_devinfo 121.It Fn pci_devinfo
122Return an ASCII description of the PCI vendor, PCI product, 122Return an ASCII description of the PCI vendor, PCI product,
123and PCI class specified by the PCI ID register 123and PCI class specified by the PCI ID register
124.Fa id_reg 124.Fa id_reg
125and PCI class ID register 125and PCI class ID register
126.Fa class_reg . 126.Fa class_reg .
127The description is placed into the buffer pointed to by 127The description is placed into the buffer pointed to by
128.Fa devinfo ; 128.Fa devinfo ;
129the size of that buffer is specified in 129the size of that buffer is specified in
130.Fa len . 130.Fa len .
131If 131If
132.Fa showclass 132.Fa showclass
133is not 0, the class, subclass and interface are added into the buffer. 133is not 0, the class, subclass and interface are added into the buffer.
134.It Fn pci_conf_print 134.It Fn pci_conf_print
135Print the PCI configuration information for the device located 135Print the PCI configuration information for the device located
136at 136at
137.Fa bus , 137.Fa bus ,
138.Fa dev , 138.Fa dev ,
139.Fa func . 139.Fa func .
140.Fa pcifd 140.Fa pcifd
141must be an open file descriptor to a PCI bus within the target PCI domain. 141must be an open file descriptor to a PCI bus within the target PCI domain.
142.It Fn pci_drvname 142.It Fn pci_drvname
143For the PCI bus opened on 143For the PCI bus opened on
144.Fa pcifd , 144.Fa pcifd ,
145return the driver name for 145return the driver name for
146.Fa dev 146.Fa dev
147and 147and
148.Fa func 148.Fa func
149into 149into
150.Fa drvname 150.Fa drvname
151using 151using
152.Fa len 152.Fa len
153as the buffer length. 153as the buffer length.
154.El 154.El
155.Sh RETURN VALUES 155.Sh RETURN VALUES
156The 156The
157.Fn pcibus_conf_read , 157.Fn pcibus_conf_read ,
158.Fn pcibus_conf_write , 158.Fn pcibus_conf_write ,
159.Fn pcidev_conf_read , 159.Fn pcidev_conf_read ,
160.Fn pcidev_conf_write , 160.Fn pcidev_conf_write ,
161.Fn pci_devinfo , 161.Fn pci_devinfo ,
162and 162and
163.Fn pci_drvname 163.Fn pci_drvname
164functions return 0 on success and \-1 on failure. 164functions return 0 on success and \-1 on failure.
165.Pp 165.Pp
166The 166The
167.Fn pci_findvendor 167.Fn pci_findvendor
168function returns 168function returns
169.Dv NULL 169.Dv NULL
170if the PCI vendor description cannot be found. 170if the PCI vendor description cannot be found.
171.Sh SEE ALSO 171.Sh SEE ALSO
172.Xr pci 4 172.Xr pci 4
173.Sh HISTORY 173.Sh HISTORY
174The 174The
175.Fn pcibus_conf_read , 175.Fn pcibus_conf_read ,
176.Fn pcibus_conf_write , 176.Fn pcibus_conf_write ,
177.Fn pcidev_conf_read , 177.Fn pcidev_conf_read ,
178.Fn pcidev_conf_write , 178.Fn pcidev_conf_write ,
179.Fn pci_findvendor , 179.Fn pci_findvendor ,
180.Fn pci_devinfo , 180.Fn pci_devinfo ,
181and 181and
182.Fn pci_conf_print 182.Fn pci_conf_print
183functions first appeared in 183functions first appeared in
184.Nx 1.6 . 184.Nx 1.6 .
185The 185The
186.Fn pci_drvname 186.Fn pci_drvname
187function first appeared in 187function first appeared in
188.Nx 7.0 . 188.Nx 7.0 .

cvs diff -r1.21 -r1.22 src/lib/libutil/login_cap.3 (switch to unified diff)

--- src/lib/libutil/login_cap.3 2013/06/23 08:38:41 1.21
+++ src/lib/libutil/login_cap.3 2016/01/23 00:43:43 1.22
@@ -1,297 +1,297 @@ @@ -1,297 +1,297 @@
1.\" $NetBSD: login_cap.3,v 1.21 2013/06/23 08:38:41 wiz Exp $ 1.\" $NetBSD: login_cap.3,v 1.22 2016/01/23 00:43:43 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1996,1997 Berkeley Software Design, Inc. All rights reserved. 3.\" Copyright (c) 1996,1997 Berkeley Software Design, Inc. All rights reserved.
4.\" 4.\"
5.\" Redistribution and use in source and binary forms, with or without 5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions 6.\" modification, are permitted provided that the following conditions
7.\" are met: 7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright 8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer. 9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the 11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution. 12.\" documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software 13.\" 3. All advertising materials mentioning features or use of this software
14.\" must display the following acknowledgement: 14.\" must display the following acknowledgement:
15.\" This product includes software developed by Berkeley Software Design, 15.\" This product includes software developed by Berkeley Software Design,
16.\" Inc. 16.\" Inc.
17.\" 4. The name of Berkeley Software Design, Inc. may not be used to endorse 17.\" 4. The name of Berkeley Software Design, Inc. may not be used to endorse
18.\" or promote products derived from this software without specific prior 18.\" or promote products derived from this software without specific prior
19.\" written permission. 19.\" written permission.
20.\" 20.\"
21.\" THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND 21.\" THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" BSDI login_cap.3,v 1.4 1997/11/07 16:22:27 jch Exp 33.\" BSDI login_cap.3,v 1.4 1997/11/07 16:22:27 jch Exp
34.\" 34.\"
35.Dd June 20, 2013 35.Dd June 20, 2013
36.Dt LOGIN_CAP 3 36.Dt LOGIN_CAP 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm login_getclass , 39.Nm login_getclass ,
40.Nm login_getcapbool , 40.Nm login_getcapbool ,
41.Nm login_getcapnum , 41.Nm login_getcapnum ,
42.Nm login_getcapsize , 42.Nm login_getcapsize ,
43.Nm login_getcapstr , 43.Nm login_getcapstr ,
44.Nm login_getcaptime , 44.Nm login_getcaptime ,
45.Nm login_getpwclass , 45.Nm login_getpwclass ,
46.Nm login_close , 46.Nm login_close ,
47.Nm setclasscontext , 47.Nm setclasscontext ,
48.Nm setusercontext 48.Nm setusercontext
49.Nd query login.conf database about a user class 49.Nd query login.conf database about a user class
50.Sh LIBRARY 50.Sh LIBRARY
51.Lb libutil 51.Lb libutil
52.Sh SYNOPSIS 52.Sh SYNOPSIS
53.In sys/types.h 53.In sys/types.h
54.In login_cap.h 54.In login_cap.h
55.Ft login_cap_t * 55.Ft login_cap_t *
56.Fn login_getclass "char *class" 56.Fn login_getclass "char *class"
57.Ft int 57.Ft int
58.Fn login_getcapbool "login_cap_t *lc" "const char *cap" "u_int def" 58.Fn login_getcapbool "login_cap_t *lc" "const char *cap" "unsigned def"
59.Ft quad_t 59.Ft quad_t
60.Fn login_getcapnum "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err" 60.Fn login_getcapnum "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err"
61.Ft quad_t 61.Ft quad_t
62.Fn login_getcapsize "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err" 62.Fn login_getcapsize "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err"
63.Ft char * 63.Ft char *
64.Fn login_getcapstr "login_cap_t *lc" "const char *cap" "char *def" "char *err" 64.Fn login_getcapstr "login_cap_t *lc" "const char *cap" "char *def" "char *err"
65.Ft quad_t 65.Ft quad_t
66.Fn login_getcaptime "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err" 66.Fn login_getcaptime "login_cap_t *lc" "const char *cap" "quad_t def" "quad_t err"
67.Ft login_cap_t * 67.Ft login_cap_t *
68.Fn login_getpwclass "struct passwd *pwd" 68.Fn login_getpwclass "struct passwd *pwd"
69.Ft void 69.Ft void
70.Fn login_close "login_cap_t *lc" 70.Fn login_close "login_cap_t *lc"
71.Ft int 71.Ft int
72.Fn setclasscontext "const char *class" "u_int flags" 72.Fn setclasscontext "const char *class" "unsigned flags"
73.Ft int 73.Ft int
74.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "u_int flags" 74.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "unsigned flags"
75.Sh DESCRIPTION 75.Sh DESCRIPTION
76The 76The
77.Fn login_getclass 77.Fn login_getclass
78function extracts the entry specified by 78function extracts the entry specified by
79.Ar class 79.Ar class
80(or 80(or
81.Li default 81.Li default
82if 82if
83.Ar class 83.Ar class
84is 84is
85.Dv NULL 85.Dv NULL
86or the empty string) 86or the empty string)
87from 87from
88.Pa /etc/login.conf 88.Pa /etc/login.conf
89(see 89(see
90.Xr login.conf 5 ) . 90.Xr login.conf 5 ) .
91If the entry is found, a 91If the entry is found, a
92.Li login_cap_t 92.Li login_cap_t
93pointer is returned. 93pointer is returned.
94.Dv NULL 94.Dv NULL
95is returned if the user class is not found. 95is returned if the user class is not found.
96When the 96When the
97.Li login_cap_t 97.Li login_cap_t
98structure is no longer needed, it should be freed by the 98structure is no longer needed, it should be freed by the
99.Fn login_close 99.Fn login_close
100function. 100function.
101.Pp 101.Pp
102The 102The
103.Fn login_getpwclass 103.Fn login_getpwclass
104function is equivalent to: 104function is equivalent to:
105.Dl login_getclass(pwd\ ? pwd->pw_class\ : NULL) 105.Dl login_getclass(pwd\ ? pwd->pw_class\ : NULL)
106.Pp 106.Pp
107Once 107Once
108.Ar lc 108.Ar lc
109has been returned by 109has been returned by
110.Fn login_getclass , 110.Fn login_getclass ,
111any of the other 111any of the other
112.Fn login_* 112.Fn login_*
113functions may be called. 113functions may be called.
114.Pp 114.Pp
115The 115The
116.Fn login_getcapnum , 116.Fn login_getcapnum ,
117.Fn login_getcapsize , 117.Fn login_getcapsize ,
118.Fn login_getcapstr , 118.Fn login_getcapstr ,
119and 119and
120.Fn login_getcaptime 120.Fn login_getcaptime
121functions all query the database entry for a field named 121functions all query the database entry for a field named
122.Ar cap . 122.Ar cap .
123If the field is found, its value is returned. 123If the field is found, its value is returned.
124If the field is not found, the value specified by 124If the field is not found, the value specified by
125.Ar def 125.Ar def
126is returned. 126is returned.
127If an error is encountered while trying to find the field, 127If an error is encountered while trying to find the field,
128.Ar err 128.Ar err
129is returned. 129is returned.
130See 130See
131.Xr login.conf 5 131.Xr login.conf 5
132for a discussion of the various textual forms the value may take. 132for a discussion of the various textual forms the value may take.
133The 133The
134.Fn login_getcapbool 134.Fn login_getcapbool
135function is slightly different. 135function is slightly different.
136It returns 136It returns
137.Ar def 137.Ar def
138if no capabilities were found for this class (typically meaning that 138if no capabilities were found for this class (typically meaning that
139the default class was used and the 139the default class was used and the
140.Li /etc/login.conf 140.Li /etc/login.conf
141file is missing). 141file is missing).
142It returns a non-zero value if 142It returns a non-zero value if
143.Ar cap , 143.Ar cap ,
144with no value, was found, 144with no value, was found,
145zero otherwise. 145zero otherwise.
146.Pp 146.Pp
147The 147The
148.Fn setclasscontext 148.Fn setclasscontext
149function takes 149function takes
150.Ar class , 150.Ar class ,
151the name of a user class, 151the name of a user class,
152and sets the resources defined by that class according to 152and sets the resources defined by that class according to
153.Ar flags . 153.Ar flags .
154Only the 154Only the
155.Dv LOGIN_SETPATH , 155.Dv LOGIN_SETPATH ,
156.Dv LOGIN_SETPRIORITY , 156.Dv LOGIN_SETPRIORITY ,
157.Dv LOGIN_SETRESOURCES , 157.Dv LOGIN_SETRESOURCES ,
158and 158and
159.Dv LOGIN_SETUMASK 159.Dv LOGIN_SETUMASK
160bits are used. 160bits are used.
161(See 161(See
162.Fn setusercontext 162.Fn setusercontext
163below). 163below).
164It returns 0 on success and -1 on failure. 164It returns 0 on success and -1 on failure.
165.Pp 165.Pp
166The 166The
167.Fn setusercontext 167.Fn setusercontext
168function 168function
169sets the resources according to 169sets the resources according to
170.Ar flags . 170.Ar flags .
171The 171The
172.Ar lc 172.Ar lc
173argument, if not 173argument, if not
174.Dv NULL , 174.Dv NULL ,
175contains the class information that should 175contains the class information that should
176be used. 176be used.
177The 177The
178.Ar pwd 178.Ar pwd
179argument, if not 179argument, if not
180.Dv NULL , 180.Dv NULL ,
181provides information about the user. 181provides information about the user.
182Both 182Both
183.Ar lc 183.Ar lc
184and 184and
185.Ar pwd 185.Ar pwd
186cannot be 186cannot be
187.Dv NULL . 187.Dv NULL .
188The 188The
189.Ar uid 189.Ar uid
190argument is used in place of the user id contained in the 190argument is used in place of the user id contained in the
191.Ar pwd 191.Ar pwd
192structure when calling 192structure when calling
193.Xr setuid 2 . 193.Xr setuid 2 .
194The various bits available to be or-ed together to make up 194The various bits available to be or-ed together to make up
195.Ar flags 195.Ar flags
196are: 196are:
197.Bl -tag -width LOGIN_SETRESOURCESXX 197.Bl -tag -width LOGIN_SETRESOURCESXX
198.It LOGIN_SETGID 198.It LOGIN_SETGID
199Set the group id. 199Set the group id.
200Requires the 200Requires the
201.Ar pwd 201.Ar pwd
202field be specified. 202field be specified.
203.It LOGIN_SETGROUPS 203.It LOGIN_SETGROUPS
204Set the group membership list by calling 204Set the group membership list by calling
205.Xr initgroups 3 . 205.Xr initgroups 3 .
206Requires the 206Requires the
207.Ar pwd 207.Ar pwd
208field be specified. 208field be specified.
209.It LOGIN_SETGROUP 209.It LOGIN_SETGROUP
210Set the group id and call 210Set the group id and call
211.Xr initgroups 3 . 211.Xr initgroups 3 .
212Requires the 212Requires the
213.Ar pwd 213.Ar pwd
214field be specified. 214field be specified.
215.It LOGIN_SETLOGIN 215.It LOGIN_SETLOGIN
216Sets the login name by 216Sets the login name by
217.Xr setlogin 2 . 217.Xr setlogin 2 .
218Requires the 218Requires the
219.Ar pwd 219.Ar pwd
220field be specified. 220field be specified.
221.It LOGIN_SETPATH 221.It LOGIN_SETPATH
222Sets the 222Sets the
223.Ev PATH 223.Ev PATH
224environment variable. 224environment variable.
225.It LOGIN_SETPRIORITY 225.It LOGIN_SETPRIORITY
226Sets the priority by 226Sets the priority by
227.Xr setpriority 2 . 227.Xr setpriority 2 .
228.It LOGIN_SETRESOURCES 228.It LOGIN_SETRESOURCES
229Sets the various system resources by 229Sets the various system resources by
230.Xr setrlimit 2 . 230.Xr setrlimit 2 .
231.It LOGIN_SETUMASK 231.It LOGIN_SETUMASK
232Sets the umask by 232Sets the umask by
233.Xr umask 2 . 233.Xr umask 2 .
234.It LOGIN_SETUSER 234.It LOGIN_SETUSER
235Sets the user id to 235Sets the user id to
236.Ar uid 236.Ar uid
237by 237by
238.Xr setuid 2 . 238.Xr setuid 2 .
239.It LOGIN_SETENV 239.It LOGIN_SETENV
240Sets the environment variables as defined by the setenv keyword, by 240Sets the environment variables as defined by the setenv keyword, by
241.Xr setenv 3 . 241.Xr setenv 3 .
242.It LOGIN_SETALL 242.It LOGIN_SETALL
243Sets all of the above. 243Sets all of the above.
244.El 244.El
245.Sh SEE ALSO 245.Sh SEE ALSO
246.Xr setlogin 2 , 246.Xr setlogin 2 ,
247.Xr setpriority 2 , 247.Xr setpriority 2 ,
248.Xr setrlimit 2 , 248.Xr setrlimit 2 ,
249.Xr setuid 2 , 249.Xr setuid 2 ,
250.Xr umask 2 , 250.Xr umask 2 ,
251.Xr initgroups 3 , 251.Xr initgroups 3 ,
252.Xr secure_path 3 , 252.Xr secure_path 3 ,
253.Xr login.conf 5 253.Xr login.conf 5
254.Sh HISTORY 254.Sh HISTORY
255The 255The
256.Nm 256.Nm
257family of functions are largely based on the 257family of functions are largely based on the
258.Bsx 258.Bsx
259implementation of same, and appeared in 259implementation of same, and appeared in
260.Nx 1.5 260.Nx 1.5
261by kind permission. 261by kind permission.
262.Sh CAVEATS 262.Sh CAVEATS
263The string returned by 263The string returned by
264.Fn login_getcapstr 264.Fn login_getcapstr
265is allocated via 265is allocated via
266.Xr malloc 3 266.Xr malloc 3
267when the specified capability is present and thus it is the responsibility 267when the specified capability is present and thus it is the responsibility
268of the caller to 268of the caller to
269.Fn free 269.Fn free
270this space. 270this space.
271However, if the capability was not found or an error occurred and 271However, if the capability was not found or an error occurred and
272.Fa def 272.Fa def
273or 273or
274.Fa err 274.Fa err
275(whichever is relevant) are 275(whichever is relevant) are
276.Pf non- Dv NULL 276.Pf non- Dv NULL
277the returned value is simply what was passed in to 277the returned value is simply what was passed in to
278.Fn login_getcapstr . 278.Fn login_getcapstr .
279Therefore it is not possible to blindly 279Therefore it is not possible to blindly
280.Fn free 280.Fn free
281the return value without first checking it against 281the return value without first checking it against
282.Fa def 282.Fa def
283and 283and
284.Fa err . 284.Fa err .
285.Pp 285.Pp
286The same warnings set forth in 286The same warnings set forth in
287.Xr setlogin 2 287.Xr setlogin 2
288apply to 288apply to
289.Fn setusercontext 289.Fn setusercontext
290when the 290when the
291.Dv LOGIN_SETLOGIN 291.Dv LOGIN_SETLOGIN
292flag is used. 292flag is used.
293Specifically, changing the login name affects all processes in the current 293Specifically, changing the login name affects all processes in the current
294session, not just the current process. 294session, not just the current process.
295See 295See
296.Xr setlogin 2 296.Xr setlogin 2
297for more information. 297for more information.