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