2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) [year] [your name]
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" Note: The date here should be updated whenever a non-trivial
30 .\" change is made to the manual page.
31 .Dd September 27, 2006
36 .Nd "example kernel interface manual page"
40 .Fn example "char *ptr" "int mode"
42 This is an example manual page for the
45 It is intended that this example can be used as a template
46 when writing a new manual page.
50 function takes two arguments:
56 may have one of the following values:
57 .Bl -tag -width ".Dv EXAMPLE_ONE"
59 First example of a defined variable.
66 The above values are defined in
73 .Sh IMPLEMENTATION NOTES
76 function is not actually implemented.
80 lock must be held before
88 no sleepable locks (i.e.,
90 locks) can be acquired in
95 function returns the value 0 if successful;
96 otherwise one of the values listed in the
98 section is returned, to indicate the error.
103 mtx_lock(&example_lock);
104 if ((error = example(NULL, EXAMPLE_ONE)) != 0) {
105 mtx_unlock(&example_lock);
108 mtx_unlock(&example_lock);
113 function has no known compatibility issues.
115 .\" Delete any errno's that are not returned by your
116 .\" function or system call and then tailor the
117 .\" remaining text as needed.
120 function will fail if:
123 Operation not permitted.
125 No such file or directory.
129 Interrupted system call.
133 Device not configured.
135 Argument list too long.
143 Resource deadlock avoided.
145 Cannot allocate memory.
151 Block device required.
159 Operation not supported by device.
167 Too many open files in system.
171 Inappropriate ioctl for device.
177 No space left on device.
181 Read-only file system.
187 Numerical argument out of domain.
191 Resource temporarily unavailable.
192 .It Bq Er EWOULDBLOCK
193 Operation would block.
194 .It Bq Er EINPROGRESS
195 Operation now in progress.
197 Operation already in progress.
199 Socket operation on non-socket.
200 .It Bq Er EDESTADDRREQ
201 Destination address required.
205 Protocol wrong type for socket.
206 .It Bq Er ENOPROTOOPT
207 Protocol not available.
208 .It Bq Er EPROTONOSUPPORT
209 Protocol not supported.
210 .It Bq Er ESOCKTNOSUPPORT
211 Socket type not supported.
213 Operation not supported.
214 .It Bq Er EPFNOSUPPORT
215 Protocol family not supported.
216 .It Bq Er EAFNOSUPPORT
217 Address family not supported by protocol family.
219 Address already in use.
220 .It Bq Er EADDRNOTAVAIL
221 Cannot assign requested address.
224 .It Bq Er ENETUNREACH
225 Network is unreachable.
227 Network dropped connection on reset.
228 .It Bq Er ECONNABORTED
229 Software causes connection abort.
231 No buffer space available.
233 Socket is already connected.
235 Socket is not connected.
237 Cannot send after socket shutdown.
238 .It Bq Er ETOOMANYREFS
239 Too many references: cannot splice.
242 .It Bq Er ECONNREFUSED
245 Too many levels of symbolic links.
246 .It Bq Er ENAMETOOLONG
250 .It Bq Er EHOSTUNREACH
261 Stale NFS file handle.
263 Too many levels of remote in path.
266 .It Bq Er ERPCMISMATCH
268 .It Bq Er EPROGUNAVAIL
269 RPC program not available.
270 .It Bq Er EPROGMISMATCH
271 Program version wrong.
272 .It Bq Er EPROCUNAVAIL
273 Bad procedure for program.
277 Function not implemented.
279 Inappropriate file type or format.
281 Authentication error.
287 No message of desired type.
289 Value too large to be stored in data type.
293 Illegal byte sequence.
307 .%T "Example RFC Title"
312 .%B "Example Book Title"
313 .%O ISBN-0-000-00000-0
318 .%J "Example Journal Name"
319 .%T "Example Article Title"
324 manual page example first appeared in
329 section examples are:
333 manual page example first appeared in
338 manual page example first appeared in
342 manual page was written by
343 .An Giorgos Keramidas Aq Mt keramida@FreeBSD.org .
345 The actual code for this function is vaporware.