xref: /freebsd/share/examples/mdoc/example.3 (revision daf1cffce2e07931f27c6c6998652e90df6ba87e)
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 2.2
38.Sh NAME
39.Nm example
40.Nd example library function manual page
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 is described below.
66.It Dv EXAMPLE_TWO
67Second example.
68.El
69.Pp
70The above value are defined in
71.Aq Pa example.h
72as follows:
73.Bd -literal
74#define EXAMPLE_ONE  1
75#define EXAMPLE_TWO  2
76.Ed
77.Sh IMPLEMENTATION NOTES
78The
79.Fn example
80function is not actually implemented.
81.Sh RETURN VALUES
82.Rv -std example
83.Sh ENVIRONMENT
84The
85.Fn example
86library function ignores the
87.Ev EXAMPLE
88environment variable.
89.Sh FILES
90.Bl -tag -width /dev/null -compact
91.It Pa /dev/null
92Example of a file in the
93.Sx FILES
94section.
95.El
96.Sh DIAGNOSTICS
97None.
98.Sh COMPATIBILITY
99The
100.Fn example
101function has no known compatibility issues.
102.Sh ERRORS
103.\" Delete any errno's that are not returned by your
104.\" function or system call and then tailor the
105.\" remaining text as needed.
106.Fn Example
107will 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 ESOCKNOTSUPORT
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 EAFNNOSUPPORT
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.El
272.Sh SEE ALSO
273.Xr example 1 ,
274.Xr example 4 ,
275.Xr mdoc 7 ,
276.Xr mdoc.samples 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 -ansiC ,
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