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