Update synopses to match u_int/u_long/etc. changes. Do not bump date as it's not a substantive change.diff -r1.14 -r1.15 src/lib/libc/net/getifaddrs.3
(dholland)
--- 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 | |
39 | The | 39 | The | |
40 | .Fn getifaddrs | 40 | .Fn getifaddrs | |
41 | function stores a reference to a linked list of the network interfaces | 41 | function stores a reference to a linked list of the network interfaces | |
42 | on the local machine in the memory referenced by | 42 | on the local machine in the memory referenced by | |
43 | .Fa ifap . | 43 | .Fa ifap . | |
44 | The list consists of | 44 | The list consists of | |
45 | .Nm ifaddrs | 45 | .Nm ifaddrs | |
46 | structures, as defined in the include file | 46 | structures, as defined in the include file | |
47 | .In ifaddrs.h . | 47 | .In ifaddrs.h . | |
48 | The | 48 | The | |
49 | .Nm ifaddrs | 49 | .Nm ifaddrs | |
50 | structure contains at least the following entries: | 50 | structure 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 | |
62 | The | 62 | The | |
63 | .Li ifa_next | 63 | .Li ifa_next | |
64 | field contains a pointer to the next structure on the list. | 64 | field contains a pointer to the next structure on the list. | |
65 | This field is | 65 | This field is | |
66 | .Dv NULL | 66 | .Dv NULL | |
67 | in last structure on the list. | 67 | in last structure on the list. | |
68 | .Pp | 68 | .Pp | |
69 | The | 69 | The | |
70 | .Li ifa_name | 70 | .Li ifa_name | |
71 | field contains the interface name. | 71 | field contains the interface name. | |
72 | .Pp | 72 | .Pp | |
73 | The | 73 | The | |
74 | .Li ifa_flags | 74 | .Li ifa_flags | |
75 | field contains the interface flags, as set by | 75 | field contains the interface flags, as set by | |
76 | .Xr ifconfig 8 | 76 | .Xr ifconfig 8 | |
77 | utility. | 77 | utility. | |
78 | .Pp | 78 | .Pp | |
79 | The | 79 | The | |
80 | .Li ifa_addr | 80 | .Li ifa_addr | |
81 | field references either the address of the interface or the link level | 81 | field references either the address of the interface or the link level | |
82 | address of the interface, if one exists, otherwise it is | 82 | address 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 | |
86 | field of the | 86 | field of the | |
87 | .Li ifa_addr | 87 | .Li ifa_addr | |
88 | field should be consulted to determine the format of the | 88 | field should be consulted to determine the format of the | |
89 | .Li ifa_addr | 89 | .Li ifa_addr | |
90 | address.) | 90 | address.) | |
91 | .Pp | 91 | .Pp | |
92 | The | 92 | The | |
93 | .Li ifa_netmask | 93 | .Li ifa_netmask | |
94 | field references the netmask associated with | 94 | field references the netmask associated with | |
95 | .Li ifa_addr , | 95 | .Li ifa_addr , | |
96 | if one is set, otherwise it is | 96 | if one is set, otherwise it is | |
97 | .Dv NULL . | 97 | .Dv NULL . | |
98 | .Pp | 98 | .Pp | |
99 | The | 99 | The | |
100 | .Li ifa_broadaddr | 100 | .Li ifa_broadaddr | |
101 | field, | 101 | field, | |
102 | which should only be referenced for non-P2P interfaces, | 102 | which should only be referenced for non-P2P interfaces, | |
103 | references the broadcast address associated with | 103 | references the broadcast address associated with | |
104 | .Li ifa_addr , | 104 | .Li ifa_addr , | |
105 | if one exists, otherwise it is | 105 | if one exists, otherwise it is | |
106 | .Dv NULL . | 106 | .Dv NULL . | |
107 | .Pp | 107 | .Pp | |
108 | The | 108 | The | |
109 | .Li ifa_dstaddr | 109 | .Li ifa_dstaddr | |
110 | field references the destination address on a P2P interface, | 110 | field references the destination address on a P2P interface, | |
111 | if one exists, otherwise it is | 111 | if one exists, otherwise it is | |
112 | .Dv NULL . | 112 | .Dv NULL . | |
113 | .Pp | 113 | .Pp | |
114 | The | 114 | The | |
115 | .Li ifa_data | 115 | .Li ifa_data | |
116 | field references address family specific data. | 116 | field references address family specific data. | |
117 | For | 117 | For | |
118 | .Dv AF_LINK | 118 | .Dv AF_LINK | |
119 | addresses it contains a pointer to the | 119 | addresses 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 | |
122 | which contains various interface attributes and statistics. | 122 | which contains various interface attributes and statistics. | |
123 | For all other address families, it is | 123 | For all other address families, it is | |
124 | .Dv NULL . | 124 | .Dv NULL . | |
125 | .Pp | 125 | .Pp | |
126 | The data returned by | 126 | The data returned by | |
127 | .Fn getifaddrs | 127 | .Fn getifaddrs | |
128 | is dynamically allocated and should be freed using | 128 | is dynamically allocated and should be freed using | |
129 | .Fn freeifaddrs | 129 | .Fn freeifaddrs | |
130 | when no longer needed. | 130 | when no longer needed. | |
131 | .Sh RETURN VALUES | 131 | .Sh RETURN VALUES | |
132 | Upon successful completion, a value of 0 is returned. | 132 | Upon successful completion, a value of 0 is returned. | |
133 | Otherwise, a value of -1 is returned and | 133 | Otherwise, a value of -1 is returned and | |
134 | .Va errno | 134 | .Va errno | |
135 | is set to indicate the error. | 135 | is set to indicate the error. | |
136 | .Sh EXAMPLES | 136 | .Sh EXAMPLES | |
137 | The following example program prints a list of all addresses configured | 137 | The following example program prints a list of all addresses configured | |
138 | on the system. | 138 | on 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 | |||
148 | int | 148 | int | |
149 | main(int argc, char *argv[]) | 149 | main(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 | |
167 | The | 167 | The | |
168 | .Fn getifaddrs | 168 | .Fn getifaddrs | |
169 | may fail and set | 169 | may fail and set | |
170 | .Va errno | 170 | .Va errno | |
171 | for any of the errors specified for the library routines | 171 | for 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 | |
175 | or | 175 | or | |
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 | |
184 | The | 184 | The | |
185 | .Nm | 185 | .Nm | |
186 | implementation first appeared in | 186 | implementation first appeared in | |
187 | .Bsx . | 187 | .Bsx . | |
188 | .Sh BUGS | 188 | .Sh BUGS | |
189 | If both | 189 | If both | |
190 | .In net/if.h | 190 | .In net/if.h | |
191 | and | 191 | and | |
192 | .In ifaddrs.h | 192 | .In ifaddrs.h | |
193 | are being included, | 193 | are being included, | |
194 | .In net/if.h | 194 | .In net/if.h | |
195 | .Em must | 195 | .Em must | |
196 | be included before | 196 | be included before | |
197 | .In ifaddrs.h . | 197 | .In ifaddrs.h . |
--- 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 | |
55 | These routines implement an efficient mechanism to find an | 55 | These routines implement an efficient mechanism to find an | |
56 | occurrence of a byte string within another byte string. | 56 | occurrence of a byte string within another byte string. | |
57 | .Pp | 57 | .Pp | |
58 | .Fn bm_comp | 58 | .Fn bm_comp | |
59 | evaluates the | 59 | evaluates the | |
60 | .Fa patlen | 60 | .Fa patlen | |
61 | bytes starting at | 61 | bytes starting at | |
62 | .Fa pattern , | 62 | .Fa pattern , | |
63 | and returns a pointer to a structure describing them. | 63 | and returns a pointer to a structure describing them. | |
64 | The bytes referenced by | 64 | The bytes referenced by | |
65 | .Fa pattern | 65 | .Fa pattern | |
66 | may be of any value. | 66 | may be of any value. | |
67 | .Pp | 67 | .Pp | |
68 | The search takes advantage of the frequency distribution of the | 68 | The search takes advantage of the frequency distribution of the | |
69 | bytes in the text to be searched. | 69 | bytes in the text to be searched. | |
70 | If specified, | 70 | If specified, | |
71 | .Fa freq | 71 | .Fa freq | |
72 | should be an array of 256 values, | 72 | should be an array of 256 values, | |
73 | with higher values indicating that the corresponding character occurs | 73 | with higher values indicating that the corresponding character occurs | |
74 | more frequently. | 74 | more 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 | |
76 | than optimal performance, not incorrect results.) | 76 | than optimal performance, not incorrect results.) | |
77 | If | 77 | If | |
78 | .Fa freq | 78 | .Fa freq | |
79 | is | 79 | is | |
80 | .Dv NULL , | 80 | .Dv NULL , | |
81 | a system default table is used. | 81 | a system default table is used. | |
82 | .Pp | 82 | .Pp | |
83 | .Fn bm_exec | 83 | .Fn bm_exec | |
84 | returns a pointer to the leftmost occurrence of the string given to | 84 | returns a pointer to the leftmost occurrence of the string given to | |
85 | .Fn bm_comp | 85 | .Fn bm_comp | |
86 | within | 86 | within | |
87 | .Fa text , | 87 | .Fa text , | |
88 | or | 88 | or | |
89 | .Dv NULL | 89 | .Dv NULL | |
90 | if none occurs. | 90 | if none occurs. | |
91 | The number of bytes in | 91 | The number of bytes in | |
92 | .Fa text | 92 | .Fa text | |
93 | must be specified by | 93 | must be specified by | |
94 | .Fa len . | 94 | .Fa len . | |
95 | .Pp | 95 | .Pp | |
96 | Space allocated for the returned description is discarded | 96 | Space allocated for the returned description is discarded | |
97 | by calling | 97 | by calling | |
98 | .Fn bm_free | 98 | .Fn bm_free | |
99 | with the returned description as an argument. | 99 | with the returned description as an argument. | |
100 | .Pp | 100 | .Pp | |
101 | The asymptotic speed of | 101 | The asymptotic speed of | |
102 | .Fn bm_exec | 102 | .Fn bm_exec | |
103 | is O(len/patlen). | 103 | is 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 |
--- 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 | |
47 | returns the set of LWPs belonging to the process specified by | 47 | returns the set of LWPs belonging to the process specified by | |
48 | .Fa pid | 48 | .Fa pid | |
49 | or | 49 | or | |
50 | .Fa procaddr | 50 | .Fa procaddr | |
51 | in the kernel indicated by | 51 | in the kernel indicated by | |
52 | .Fa kd . | 52 | .Fa kd . | |
53 | The number of LWPs found is returned in the reference parameter | 53 | The number of LWPs found is returned in the reference parameter | |
54 | .Fa cnt . | 54 | .Fa cnt . | |
55 | The LWPs are returned as a contiguous array of | 55 | The LWPs are returned as a contiguous array of | |
56 | .Sy kinfo_lwp | 56 | .Sy kinfo_lwp | |
57 | structures. | 57 | structures. | |
58 | This memory is locally allocated, and subsequent calls to | 58 | This memory is locally allocated, and subsequent calls to | |
59 | .Fn kvm_getlwps | 59 | .Fn kvm_getlwps | |
60 | and | 60 | and | |
61 | .Fn kvm_close | 61 | .Fn kvm_close | |
62 | will overwrite this storage. | 62 | will overwrite this storage. | |
63 | .Pp | 63 | .Pp | |
64 | Only the first | 64 | Only the first | |
65 | .Fa elemsize | 65 | .Fa elemsize | |
66 | bytes of each array entry are returned. | 66 | bytes of each array entry are returned. | |
67 | If the size of the | 67 | If the size of the | |
68 | .Sy kinfo_lwp | 68 | .Sy kinfo_lwp | |
69 | structure increases in size in a future release of | 69 | structure increases in size in a future release of | |
70 | .Nx | 70 | .Nx | |
71 | the kernel will only return the requested amount of data for | 71 | the kernel will only return the requested amount of data for | |
72 | each array entry and programs that use | 72 | each array entry and programs that use | |
73 | .Fn kvm_getlwps | 73 | .Fn kvm_getlwps | |
74 | will continue to function without the need for recompilation. | 74 | will continue to function without the need for recompilation. | |
75 | .Pp | 75 | .Pp | |
76 | If called against an active kernel, the | 76 | If called against an active kernel, the | |
77 | .Fn kvm_getlwps | 77 | .Fn kvm_getlwps | |
78 | function will use the | 78 | function will use the | |
79 | .Xr sysctl 3 | 79 | .Xr sysctl 3 | |
80 | interface and return information about the process identified by | 80 | interface and return information about the process identified by | |
81 | .Fa pid ; | 81 | .Fa pid ; | |
82 | otherwise the kernel memory device file or swap device will be | 82 | otherwise the kernel memory device file or swap device will be | |
83 | accessed and the process is identified by the location passed in | 83 | accessed 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 | |
87 | returns | 87 | returns | |
88 | .Dv NULL | 88 | .Dv NULL | |
89 | on failure. | 89 | on 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 | |
102 | These routines do not belong in the kvm interface. | 102 | These routines do not belong in the kvm interface. |
--- 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 | |
52 | The | 52 | The | |
53 | .Fn kvm_read | 53 | .Fn kvm_read | |
54 | and | 54 | and | |
55 | .Fn kvm_write | 55 | .Fn kvm_write | |
56 | functions are used to read and write kernel virtual memory (or a crash | 56 | functions are used to read and write kernel virtual memory (or a crash | |
57 | dump file). | 57 | dump file). | |
58 | See | 58 | See | |
59 | .Fn kvm_open 3 | 59 | .Fn kvm_open 3 | |
60 | or | 60 | or | |
61 | .Fn kvm_openfiles 3 | 61 | .Fn kvm_openfiles 3 | |
62 | for information regarding opening kernel virtual memory and crash dumps. | 62 | for information regarding opening kernel virtual memory and crash dumps. | |
63 | .Pp | 63 | .Pp | |
64 | The | 64 | The | |
65 | .Fn kvm_read | 65 | .Fn kvm_read | |
66 | function transfers | 66 | function transfers | |
67 | .Fa nbytes | 67 | .Fa nbytes | |
68 | bytes of data from | 68 | bytes of data from | |
69 | the kernel space address | 69 | the kernel space address | |
70 | .Fa addr | 70 | .Fa addr | |
71 | to | 71 | to | |
72 | .Fa buf . | 72 | .Fa buf . | |
73 | Conversely, | 73 | Conversely, | |
74 | .Fn kvm_write | 74 | .Fn kvm_write | |
75 | transfers data from | 75 | transfers data from | |
76 | .Fa buf | 76 | .Fa buf | |
77 | to | 77 | to | |
78 | .Fa addr . | 78 | .Fa addr . | |
79 | Unlike their SunOS counterparts, these functions cannot be used to | 79 | Unlike their SunOS counterparts, these functions cannot be used to | |
80 | read or write process address spaces. | 80 | read or write process address spaces. | |
81 | .Sh RETURN VALUES | 81 | .Sh RETURN VALUES | |
82 | Upon success, the number of bytes actually transferred is returned. | 82 | Upon success, the number of bytes actually transferred is returned. | |
83 | Otherwise, -1 is returned. | 83 | Otherwise, -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 |
--- 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 | |
65 | The | 65 | The | |
66 | .Nm | 66 | .Nm | |
67 | library provides support for accessing the PCI bus by user programs. | 67 | library provides support for accessing the PCI bus by user programs. | |
68 | .Pp | 68 | .Pp | |
69 | These functions are available in the | 69 | These functions are available in the | |
70 | .Nm libpci | 70 | .Nm libpci | |
71 | library. | 71 | library. | |
72 | Programs should be linked with | 72 | Programs should be linked with | |
73 | .Fl lpci . | 73 | .Fl lpci . | |
74 | .Sh CONFIGURATION SPACE FUNCTIONS | 74 | .Sh CONFIGURATION SPACE FUNCTIONS | |
75 | The following functions are used to access PCI configuration space: | 75 | The 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 | |
78 | Access the PCI configuration register | 78 | Access the PCI configuration register | |
79 | .Fa reg | 79 | .Fa reg | |
80 | on the device located at | 80 | on the device located at | |
81 | .Fa bus , | 81 | .Fa bus , | |
82 | .Fa dev , | 82 | .Fa dev , | |
83 | .Fa func , | 83 | .Fa func , | |
84 | and place the result in | 84 | and place the result in | |
85 | .Fa *valp . | 85 | .Fa *valp . | |
86 | .Fa pcifd | 86 | .Fa pcifd | |
87 | must be an open file descriptor to a PCI bus within the target PCI domain. | 87 | must 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 | |
89 | Write the value specified by | 89 | Write the value specified by | |
90 | .Fa val | 90 | .Fa val | |
91 | into the PCI configuration register | 91 | into the PCI configuration register | |
92 | .Fa reg | 92 | .Fa reg | |
93 | on the device located at | 93 | on 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 | |
98 | must be an open file descriptor to a PCI bus within the target PCI domain. | 98 | must 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 | |
100 | Access the PCI configuration register | 100 | Access the PCI configuration register | |
101 | .Fa reg | 101 | .Fa reg | |
102 | on the device associated with the open file descriptor | 102 | on the device associated with the open file descriptor | |
103 | .Fa devfd | 103 | .Fa devfd | |
104 | and place the result in | 104 | and place the result in | |
105 | .Fa *valp . | 105 | .Fa *valp . | |
106 | .It Fn pcidev_conf_write | 106 | .It Fn pcidev_conf_write | |
107 | Write the value specified by | 107 | Write the value specified by | |
108 | .Fa val | 108 | .Fa val | |
109 | into the PCI configuration register | 109 | into the PCI configuration register | |
110 | .Fa reg | 110 | .Fa reg | |
111 | on the device associated with the open file descriptor | 111 | on 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 | |
115 | The following miscellaneous functions are available: | 115 | The 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 | |
118 | Return an ASCII description of the PCI vendor in the | 118 | Return an ASCII description of the PCI vendor in the | |
119 | PCI ID register | 119 | PCI ID register | |
120 | .Fa id_reg . | 120 | .Fa id_reg . | |
121 | .It Fn pci_devinfo | 121 | .It Fn pci_devinfo | |
122 | Return an ASCII description of the PCI vendor, PCI product, | 122 | Return an ASCII description of the PCI vendor, PCI product, | |
123 | and PCI class specified by the PCI ID register | 123 | and PCI class specified by the PCI ID register | |
124 | .Fa id_reg | 124 | .Fa id_reg | |
125 | and PCI class ID register | 125 | and PCI class ID register | |
126 | .Fa class_reg . | 126 | .Fa class_reg . | |
127 | The description is placed into the buffer pointed to by | 127 | The description is placed into the buffer pointed to by | |
128 | .Fa devinfo ; | 128 | .Fa devinfo ; | |
129 | the size of that buffer is specified in | 129 | the size of that buffer is specified in | |
130 | .Fa len . | 130 | .Fa len . | |
131 | If | 131 | If | |
132 | .Fa showclass | 132 | .Fa showclass | |
133 | is not 0, the class, subclass and interface are added into the buffer. | 133 | is not 0, the class, subclass and interface are added into the buffer. | |
134 | .It Fn pci_conf_print | 134 | .It Fn pci_conf_print | |
135 | Print the PCI configuration information for the device located | 135 | Print the PCI configuration information for the device located | |
136 | at | 136 | at | |
137 | .Fa bus , | 137 | .Fa bus , | |
138 | .Fa dev , | 138 | .Fa dev , | |
139 | .Fa func . | 139 | .Fa func . | |
140 | .Fa pcifd | 140 | .Fa pcifd | |
141 | must be an open file descriptor to a PCI bus within the target PCI domain. | 141 | must be an open file descriptor to a PCI bus within the target PCI domain. | |
142 | .It Fn pci_drvname | 142 | .It Fn pci_drvname | |
143 | For the PCI bus opened on | 143 | For the PCI bus opened on | |
144 | .Fa pcifd , | 144 | .Fa pcifd , | |
145 | return the driver name for | 145 | return the driver name for | |
146 | .Fa dev | 146 | .Fa dev | |
147 | and | 147 | and | |
148 | .Fa func | 148 | .Fa func | |
149 | into | 149 | into | |
150 | .Fa drvname | 150 | .Fa drvname | |
151 | using | 151 | using | |
152 | .Fa len | 152 | .Fa len | |
153 | as the buffer length. | 153 | as the buffer length. | |
154 | .El | 154 | .El | |
155 | .Sh RETURN VALUES | 155 | .Sh RETURN VALUES | |
156 | The | 156 | The | |
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 , | |
162 | and | 162 | and | |
163 | .Fn pci_drvname | 163 | .Fn pci_drvname | |
164 | functions return 0 on success and \-1 on failure. | 164 | functions return 0 on success and \-1 on failure. | |
165 | .Pp | 165 | .Pp | |
166 | The | 166 | The | |
167 | .Fn pci_findvendor | 167 | .Fn pci_findvendor | |
168 | function returns | 168 | function returns | |
169 | .Dv NULL | 169 | .Dv NULL | |
170 | if the PCI vendor description cannot be found. | 170 | if 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 | |
174 | The | 174 | The | |
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 , | |
181 | and | 181 | and | |
182 | .Fn pci_conf_print | 182 | .Fn pci_conf_print | |
183 | functions first appeared in | 183 | functions first appeared in | |
184 | .Nx 1.6 . | 184 | .Nx 1.6 . | |
185 | The | 185 | The | |
186 | .Fn pci_drvname | 186 | .Fn pci_drvname | |
187 | function first appeared in | 187 | function first appeared in | |
188 | .Nx 7.0 . | 188 | .Nx 7.0 . |
--- 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 | |
76 | The | 76 | The | |
77 | .Fn login_getclass | 77 | .Fn login_getclass | |
78 | function extracts the entry specified by | 78 | function extracts the entry specified by | |
79 | .Ar class | 79 | .Ar class | |
80 | (or | 80 | (or | |
81 | .Li default | 81 | .Li default | |
82 | if | 82 | if | |
83 | .Ar class | 83 | .Ar class | |
84 | is | 84 | is | |
85 | .Dv NULL | 85 | .Dv NULL | |
86 | or the empty string) | 86 | or the empty string) | |
87 | from | 87 | from | |
88 | .Pa /etc/login.conf | 88 | .Pa /etc/login.conf | |
89 | (see | 89 | (see | |
90 | .Xr login.conf 5 ) . | 90 | .Xr login.conf 5 ) . | |
91 | If the entry is found, a | 91 | If the entry is found, a | |
92 | .Li login_cap_t | 92 | .Li login_cap_t | |
93 | pointer is returned. | 93 | pointer is returned. | |
94 | .Dv NULL | 94 | .Dv NULL | |
95 | is returned if the user class is not found. | 95 | is returned if the user class is not found. | |
96 | When the | 96 | When the | |
97 | .Li login_cap_t | 97 | .Li login_cap_t | |
98 | structure is no longer needed, it should be freed by the | 98 | structure is no longer needed, it should be freed by the | |
99 | .Fn login_close | 99 | .Fn login_close | |
100 | function. | 100 | function. | |
101 | .Pp | 101 | .Pp | |
102 | The | 102 | The | |
103 | .Fn login_getpwclass | 103 | .Fn login_getpwclass | |
104 | function is equivalent to: | 104 | function 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 | |
107 | Once | 107 | Once | |
108 | .Ar lc | 108 | .Ar lc | |
109 | has been returned by | 109 | has been returned by | |
110 | .Fn login_getclass , | 110 | .Fn login_getclass , | |
111 | any of the other | 111 | any of the other | |
112 | .Fn login_* | 112 | .Fn login_* | |
113 | functions may be called. | 113 | functions may be called. | |
114 | .Pp | 114 | .Pp | |
115 | The | 115 | The | |
116 | .Fn login_getcapnum , | 116 | .Fn login_getcapnum , | |
117 | .Fn login_getcapsize , | 117 | .Fn login_getcapsize , | |
118 | .Fn login_getcapstr , | 118 | .Fn login_getcapstr , | |
119 | and | 119 | and | |
120 | .Fn login_getcaptime | 120 | .Fn login_getcaptime | |
121 | functions all query the database entry for a field named | 121 | functions all query the database entry for a field named | |
122 | .Ar cap . | 122 | .Ar cap . | |
123 | If the field is found, its value is returned. | 123 | If the field is found, its value is returned. | |
124 | If the field is not found, the value specified by | 124 | If the field is not found, the value specified by | |
125 | .Ar def | 125 | .Ar def | |
126 | is returned. | 126 | is returned. | |
127 | If an error is encountered while trying to find the field, | 127 | If an error is encountered while trying to find the field, | |
128 | .Ar err | 128 | .Ar err | |
129 | is returned. | 129 | is returned. | |
130 | See | 130 | See | |
131 | .Xr login.conf 5 | 131 | .Xr login.conf 5 | |
132 | for a discussion of the various textual forms the value may take. | 132 | for a discussion of the various textual forms the value may take. | |
133 | The | 133 | The | |
134 | .Fn login_getcapbool | 134 | .Fn login_getcapbool | |
135 | function is slightly different. | 135 | function is slightly different. | |
136 | It returns | 136 | It returns | |
137 | .Ar def | 137 | .Ar def | |
138 | if no capabilities were found for this class (typically meaning that | 138 | if no capabilities were found for this class (typically meaning that | |
139 | the default class was used and the | 139 | the default class was used and the | |
140 | .Li /etc/login.conf | 140 | .Li /etc/login.conf | |
141 | file is missing). | 141 | file is missing). | |
142 | It returns a non-zero value if | 142 | It returns a non-zero value if | |
143 | .Ar cap , | 143 | .Ar cap , | |
144 | with no value, was found, | 144 | with no value, was found, | |
145 | zero otherwise. | 145 | zero otherwise. | |
146 | .Pp | 146 | .Pp | |
147 | The | 147 | The | |
148 | .Fn setclasscontext | 148 | .Fn setclasscontext | |
149 | function takes | 149 | function takes | |
150 | .Ar class , | 150 | .Ar class , | |
151 | the name of a user class, | 151 | the name of a user class, | |
152 | and sets the resources defined by that class according to | 152 | and sets the resources defined by that class according to | |
153 | .Ar flags . | 153 | .Ar flags . | |
154 | Only the | 154 | Only 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 , | |
158 | and | 158 | and | |
159 | .Dv LOGIN_SETUMASK | 159 | .Dv LOGIN_SETUMASK | |
160 | bits are used. | 160 | bits are used. | |
161 | (See | 161 | (See | |
162 | .Fn setusercontext | 162 | .Fn setusercontext | |
163 | below). | 163 | below). | |
164 | It returns 0 on success and -1 on failure. | 164 | It returns 0 on success and -1 on failure. | |
165 | .Pp | 165 | .Pp | |
166 | The | 166 | The | |
167 | .Fn setusercontext | 167 | .Fn setusercontext | |
168 | function | 168 | function | |
169 | sets the resources according to | 169 | sets the resources according to | |
170 | .Ar flags . | 170 | .Ar flags . | |
171 | The | 171 | The | |
172 | .Ar lc | 172 | .Ar lc | |
173 | argument, if not | 173 | argument, if not | |
174 | .Dv NULL , | 174 | .Dv NULL , | |
175 | contains the class information that should | 175 | contains the class information that should | |
176 | be used. | 176 | be used. | |
177 | The | 177 | The | |
178 | .Ar pwd | 178 | .Ar pwd | |
179 | argument, if not | 179 | argument, if not | |
180 | .Dv NULL , | 180 | .Dv NULL , | |
181 | provides information about the user. | 181 | provides information about the user. | |
182 | Both | 182 | Both | |
183 | .Ar lc | 183 | .Ar lc | |
184 | and | 184 | and | |
185 | .Ar pwd | 185 | .Ar pwd | |
186 | cannot be | 186 | cannot be | |
187 | .Dv NULL . | 187 | .Dv NULL . | |
188 | The | 188 | The | |
189 | .Ar uid | 189 | .Ar uid | |
190 | argument is used in place of the user id contained in the | 190 | argument is used in place of the user id contained in the | |
191 | .Ar pwd | 191 | .Ar pwd | |
192 | structure when calling | 192 | structure when calling | |
193 | .Xr setuid 2 . | 193 | .Xr setuid 2 . | |
194 | The various bits available to be or-ed together to make up | 194 | The various bits available to be or-ed together to make up | |
195 | .Ar flags | 195 | .Ar flags | |
196 | are: | 196 | are: | |
197 | .Bl -tag -width LOGIN_SETRESOURCESXX | 197 | .Bl -tag -width LOGIN_SETRESOURCESXX | |
198 | .It LOGIN_SETGID | 198 | .It LOGIN_SETGID | |
199 | Set the group id. | 199 | Set the group id. | |
200 | Requires the | 200 | Requires the | |
201 | .Ar pwd | 201 | .Ar pwd | |
202 | field be specified. | 202 | field be specified. | |
203 | .It LOGIN_SETGROUPS | 203 | .It LOGIN_SETGROUPS | |
204 | Set the group membership list by calling | 204 | Set the group membership list by calling | |
205 | .Xr initgroups 3 . | 205 | .Xr initgroups 3 . | |
206 | Requires the | 206 | Requires the | |
207 | .Ar pwd | 207 | .Ar pwd | |
208 | field be specified. | 208 | field be specified. | |
209 | .It LOGIN_SETGROUP | 209 | .It LOGIN_SETGROUP | |
210 | Set the group id and call | 210 | Set the group id and call | |
211 | .Xr initgroups 3 . | 211 | .Xr initgroups 3 . | |
212 | Requires the | 212 | Requires the | |
213 | .Ar pwd | 213 | .Ar pwd | |
214 | field be specified. | 214 | field be specified. | |
215 | .It LOGIN_SETLOGIN | 215 | .It LOGIN_SETLOGIN | |
216 | Sets the login name by | 216 | Sets the login name by | |
217 | .Xr setlogin 2 . | 217 | .Xr setlogin 2 . | |
218 | Requires the | 218 | Requires the | |
219 | .Ar pwd | 219 | .Ar pwd | |
220 | field be specified. | 220 | field be specified. | |
221 | .It LOGIN_SETPATH | 221 | .It LOGIN_SETPATH | |
222 | Sets the | 222 | Sets the | |
223 | .Ev PATH | 223 | .Ev PATH | |
224 | environment variable. | 224 | environment variable. | |
225 | .It LOGIN_SETPRIORITY | 225 | .It LOGIN_SETPRIORITY | |
226 | Sets the priority by | 226 | Sets the priority by | |
227 | .Xr setpriority 2 . | 227 | .Xr setpriority 2 . | |
228 | .It LOGIN_SETRESOURCES | 228 | .It LOGIN_SETRESOURCES | |
229 | Sets the various system resources by | 229 | Sets the various system resources by | |
230 | .Xr setrlimit 2 . | 230 | .Xr setrlimit 2 . | |
231 | .It LOGIN_SETUMASK | 231 | .It LOGIN_SETUMASK | |
232 | Sets the umask by | 232 | Sets the umask by | |
233 | .Xr umask 2 . | 233 | .Xr umask 2 . | |
234 | .It LOGIN_SETUSER | 234 | .It LOGIN_SETUSER | |
235 | Sets the user id to | 235 | Sets the user id to | |
236 | .Ar uid | 236 | .Ar uid | |
237 | by | 237 | by | |
238 | .Xr setuid 2 . | 238 | .Xr setuid 2 . | |
239 | .It LOGIN_SETENV | 239 | .It LOGIN_SETENV | |
240 | Sets the environment variables as defined by the setenv keyword, by | 240 | Sets 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 | |
243 | Sets all of the above. | 243 | Sets 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 | |
255 | The | 255 | The | |
256 | .Nm | 256 | .Nm | |
257 | family of functions are largely based on the | 257 | family of functions are largely based on the | |
258 | .Bsx | 258 | .Bsx | |
259 | implementation of same, and appeared in | 259 | implementation of same, and appeared in | |
260 | .Nx 1.5 | 260 | .Nx 1.5 | |
261 | by kind permission. | 261 | by kind permission. | |
262 | .Sh CAVEATS | 262 | .Sh CAVEATS | |
263 | The string returned by | 263 | The string returned by | |
264 | .Fn login_getcapstr | 264 | .Fn login_getcapstr | |
265 | is allocated via | 265 | is allocated via | |
266 | .Xr malloc 3 | 266 | .Xr malloc 3 | |
267 | when the specified capability is present and thus it is the responsibility | 267 | when the specified capability is present and thus it is the responsibility | |
268 | of the caller to | 268 | of the caller to | |
269 | .Fn free | 269 | .Fn free | |
270 | this space. | 270 | this space. | |
271 | However, if the capability was not found or an error occurred and | 271 | However, if the capability was not found or an error occurred and | |
272 | .Fa def | 272 | .Fa def | |
273 | or | 273 | or | |
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 | |
277 | the returned value is simply what was passed in to | 277 | the returned value is simply what was passed in to | |
278 | .Fn login_getcapstr . | 278 | .Fn login_getcapstr . | |
279 | Therefore it is not possible to blindly | 279 | Therefore it is not possible to blindly | |
280 | .Fn free | 280 | .Fn free | |
281 | the return value without first checking it against | 281 | the return value without first checking it against | |
282 | .Fa def | 282 | .Fa def | |
283 | and | 283 | and | |
284 | .Fa err . | 284 | .Fa err . | |
285 | .Pp | 285 | .Pp | |
286 | The same warnings set forth in | 286 | The same warnings set forth in | |
287 | .Xr setlogin 2 | 287 | .Xr setlogin 2 | |
288 | apply to | 288 | apply to | |
289 | .Fn setusercontext | 289 | .Fn setusercontext | |
290 | when the | 290 | when the | |
291 | .Dv LOGIN_SETLOGIN | 291 | .Dv LOGIN_SETLOGIN | |
292 | flag is used. | 292 | flag is used. | |
293 | Specifically, changing the login name affects all processes in the current | 293 | Specifically, changing the login name affects all processes in the current | |
294 | session, not just the current process. | 294 | session, not just the current process. | |
295 | See | 295 | See | |
296 | .Xr setlogin 2 | 296 | .Xr setlogin 2 | |
297 | for more information. | 297 | for more information. |