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