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