xref: /freebsd/share/examples/mdoc/example.3 (revision 0957b409)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3.\"
4.\" Copyright (c) [year] [your name]
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
14.\"
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
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.\" Note: The date here should be updated whenever a non-trivial
30.\" change is made to the manual page.
31.Dd July 30, 2004
32.Dt EXAMPLE 3
33.Os
34.Sh NAME
35.Nm example
36.Nd "example library function manual page"
37.Sh LIBRARY
38.\" Note: list of available libraries is available in mdoc(7)
39.Lb libc
40.Sh SYNOPSIS
41.In example.h
42.Ft int
43.Fn example "char *ptr" "int mode"
44.Sh DESCRIPTION
45This is an example library function manual page for the
46.Fn example
47function.
48It is intended that this example can be used as a template
49when writing a new manual page.
50.Pp
51The
52.Fn example
53function takes two arguments:
54.Fa ptr
55and
56.Fa mode .
57The argument
58.Fa mode
59may have one of the following values:
60.Bl -tag -width ".Dv EXAMPLE_ONE"
61.It Dv EXAMPLE_ONE
62First example of a defined variable.
63.Dv EXAMPLE_ONE
64is described below.
65.It Dv EXAMPLE_TWO
66Second example.
67.El
68.Pp
69The above values are defined in
70.In example.h
71as follows:
72.Bd -literal
73#define EXAMPLE_ONE  1
74#define EXAMPLE_TWO  2
75.Ed
76.Sh IMPLEMENTATION NOTES
77The
78.Fn example
79function is not actually implemented.
80.Sh RETURN VALUES
81.Rv -std example
82.Sh ENVIRONMENT
83The
84.Fn example
85library function ignores the
86.Ev EXAMPLE
87environment variable.
88.Sh FILES
89.Bl -tag -width ".Pa /dev/null" -compact
90.It Pa /dev/null
91Example of a file in the
92.Sx FILES
93section.
94.El
95.Sh DIAGNOSTICS
96None.
97.Sh COMPATIBILITY
98The
99.Fn example
100function has no known compatibility issues.
101.Sh ERRORS
102.\" Delete any errno's that are not returned by your
103.\" function or system call and then tailor the
104.\" remaining text as needed.
105The
106.Fn example
107function will fail if:
108.Bl -tag -width Er
109.It Bq Er EPERM
110Operation not permitted.
111.It Bq Er ENOENT
112No such file or directory.
113.It Bq Er ESRCH
114No such process.
115.It Bq Er EINTR
116Interrupted system call.
117.It Bq Er EIO
118Input/output error.
119.It Bq Er ENXIO
120Device not configured.
121.It Bq Er E2BIG
122Argument list too long.
123.It Bq Er ENOEXEC
124Exec format error.
125.It Bq Er EBADF
126Bad file descriptor.
127.It Bq Er ECHILD
128No child processes.
129.It Bq Er EDEADLK
130Resource deadlock avoided.
131.It Bq Er ENOMEM
132Cannot allocate memory.
133.It Bq Er EACCES
134Permission denied.
135.It Bq Er EFAULT
136Bad address.
137.It Bq Er ENOTBLK
138Block device required.
139.It Bq Er EBUSY
140Device busy.
141.It Bq Er EEXIST
142File exists.
143.It Bq Er EXDEV
144Cross-device link.
145.It Bq Er ENODEV
146Operation not supported by device.
147.It Bq Er ENOTDIR
148Not a directory.
149.It Bq Er EISDIR
150Is a directory.
151.It Bq Er EINVAL
152Invalid argument.
153.It Bq Er ENFILE
154Too many open files in system.
155.It Bq Er EMFILE
156Too many open files.
157.It Bq Er ENOTTY
158Inappropriate ioctl for device.
159.It Bq Er ETXTBSY
160Text file busy.
161.It Bq Er EFBIG
162File too large.
163.It Bq Er ENOSPC
164No space left on device.
165.It Bq Er ESPIPE
166Illegal seek.
167.It Bq Er EROFS
168Read-only file system.
169.It Bq Er EMLINK
170Too many links.
171.It Bq Er EPIPE
172Broken pipe.
173.It Bq Er EDOM
174Numerical argument out of domain.
175.It Bq Er ERANGE
176Result too large.
177.It Bq Er EAGAIN
178Resource temporarily unavailable.
179.It Bq Er EWOULDBLOCK
180Operation would block.
181.It Bq Er EINPROGRESS
182Operation now in progress.
183.It Bq Er EALREADY
184Operation already in progress.
185.It Bq Er ENOTSOCK
186Socket operation on non-socket.
187.It Bq Er EDESTADDRREQ
188Destination address required.
189.It Bq Er EMSGSIZE
190Message too long.
191.It Bq Er EPROTOTYPE
192Protocol wrong type for socket.
193.It Bq Er ENOPROTOOPT
194Protocol not available.
195.It Bq Er EPROTONOSUPPORT
196Protocol not supported.
197.It Bq Er ESOCKTNOSUPPORT
198Socket type not supported.
199.It Bq Er EOPNOTSUPP
200Operation not supported.
201.It Bq Er EPFNOSUPPORT
202Protocol family not supported.
203.It Bq Er EAFNOSUPPORT
204Address family not supported by protocol family.
205.It Bq Er EADDRINUSE
206Address already in use.
207.It Bq Er EADDRNOTAVAIL
208Cannot assign requested address.
209.It Bq Er ENETDOWN
210Network is down.
211.It Bq Er ENETUNREACH
212Network is unreachable.
213.It Bq Er ENETRESET
214Network dropped connection on reset.
215.It Bq Er ECONNABORTED
216Software causes connection abort.
217.It Bq Er ENOBUFS
218No buffer space available.
219.It Bq Er EISCONN
220Socket is already connected.
221.It Bq Er ENOTCONN
222Socket is not connected.
223.It Bq Er ESHUTDOWN
224Cannot send after socket shutdown.
225.It Bq Er ETOOMANYREFS
226Too many references: cannot splice.
227.It Bq Er ETIMEDOUT
228Operation timed out.
229.It Bq Er ECONNREFUSED
230Connection refused.
231.It Bq Er ELOOP
232Too many levels of symbolic links.
233.It Bq Er ENAMETOOLONG
234File name too long.
235.It Bq Er EHOSTDOWN
236Host is down.
237.It Bq Er EHOSTUNREACH
238No route to host.
239.It Bq Er ENOTEMPTY
240Directory not empty.
241.It Bq Er EPROCLIM
242Too many processes.
243.It Bq Er EUSERS
244Too many users.
245.It Bq Er EDQUOT
246Disc quota exceeded.
247.It Bq Er ESTALE
248Stale NFS file handle.
249.It Bq Er EREMOTE
250Too many levels of remote in path.
251.It Bq Er EBADRPC
252RPC struct is bad.
253.It Bq Er ERPCMISMATCH
254RPC version wrong.
255.It Bq Er EPROGUNAVAIL
256RPC program not available.
257.It Bq Er EPROGMISMATCH
258Program version wrong.
259.It Bq Er EPROCUNAVAIL
260Bad procedure for program.
261.It Bq Er ENOLCK
262No locks available.
263.It Bq Er ENOSYS
264Function not implemented.
265.It Bq Er EFTYPE
266Inappropriate file type or format.
267.It Bq Er EAUTH
268Authentication error.
269.It Bq Er ENEEDAUTH
270Need authenticator.
271.It Bq Er EIDRM
272Identifier removed.
273.It Bq Er ENOMSG
274No message of desired type.
275.It Bq Er EOVERFLOW
276Value too large to be stored in data type.
277.It Bq Er ECANCELED
278Operation canceled.
279.It Bq Er EILSEQ
280Illegal byte sequence.
281.It Bq Er ENOATTR
282Attribute not found.
283.It Bq Er EDOOFUS
284Programming error.
285.El
286.Sh SEE ALSO
287.Xr example 1 ,
288.Xr example 4 ,
289.Xr mdoc 7 ,
290.Xr example 9
291.Rs
292.%A "A. B. Author"
293.%T "Example RFC Title"
294.%O RFC0000
295.Re
296.Rs
297.%A "A. B. Author"
298.%B "Example Book Title"
299.%O ISBN-0-000-00000-0
300.Re
301.Rs
302.%A "A. B. Author"
303.%D "January 1997"
304.%J "Example Journal Name"
305.%T "Example Article Title"
306.Re
307.Sh STANDARDS
308If the function conforms to some standard, such as
309.St -p1003.1-2004
310or
311.St -isoC-99 ,
312it should be noted here.
313.Sh HISTORY
314The
315.Nm
316manual page example first appeared in
317.Fx 2.2 .
318.Pp
319Some other common
320.Sx HISTORY
321section examples are:
322.Pp
323The
324.Nm
325manual page example first appeared in
326.Bx 4.4 .
327.Pp
328The
329.Nm
330manual page example first appeared in
331.At v6 .
332.Sh AUTHORS
333This
334manual page was written by
335.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
336.Sh BUGS
337The actual code for this function is vaporware.
338