xref: /freebsd/share/examples/mdoc/example.3 (revision 780fb4a2)
1.\" Copyright (c) [year] [your name]
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\"    notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\"    notice, this list of conditions and the following disclaimer in the
10.\"    documentation and/or other materials provided with the distribution.
11.\"
12.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22.\" SUCH DAMAGE.
23.\"
24.\" $FreeBSD$
25.\"
26.\" Note: The date here should be updated whenever a non-trivial
27.\" change is made to the manual page.
28.Dd July 30, 2004
29.Dt EXAMPLE 3
30.Os
31.Sh NAME
32.Nm example
33.Nd "example library function manual page"
34.Sh LIBRARY
35.\" Note: list of available libraries is available in mdoc(7)
36.Lb libc
37.Sh SYNOPSIS
38.In example.h
39.Ft int
40.Fn example "char *ptr" "int mode"
41.Sh DESCRIPTION
42This is an example library function manual page for the
43.Fn example
44function.
45It is intended that this example can be used as a template
46when writing a new manual page.
47.Pp
48The
49.Fn example
50function takes two arguments:
51.Fa ptr
52and
53.Fa mode .
54The argument
55.Fa mode
56may have one of the following values:
57.Bl -tag -width ".Dv EXAMPLE_ONE"
58.It Dv EXAMPLE_ONE
59First example of a defined variable.
60.Dv EXAMPLE_ONE
61is described below.
62.It Dv EXAMPLE_TWO
63Second example.
64.El
65.Pp
66The above values are defined in
67.In example.h
68as follows:
69.Bd -literal
70#define EXAMPLE_ONE  1
71#define EXAMPLE_TWO  2
72.Ed
73.Sh IMPLEMENTATION NOTES
74The
75.Fn example
76function is not actually implemented.
77.Sh RETURN VALUES
78.Rv -std example
79.Sh ENVIRONMENT
80The
81.Fn example
82library function ignores the
83.Ev EXAMPLE
84environment variable.
85.Sh FILES
86.Bl -tag -width ".Pa /dev/null" -compact
87.It Pa /dev/null
88Example of a file in the
89.Sx FILES
90section.
91.El
92.Sh DIAGNOSTICS
93None.
94.Sh COMPATIBILITY
95The
96.Fn example
97function has no known compatibility issues.
98.Sh ERRORS
99.\" Delete any errno's that are not returned by your
100.\" function or system call and then tailor the
101.\" remaining text as needed.
102The
103.Fn example
104function will 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.It Bq Er EIDRM
269Identifier removed.
270.It Bq Er ENOMSG
271No message of desired type.
272.It Bq Er EOVERFLOW
273Value too large to be stored in data type.
274.It Bq Er ECANCELED
275Operation canceled.
276.It Bq Er EILSEQ
277Illegal byte sequence.
278.It Bq Er ENOATTR
279Attribute not found.
280.It Bq Er EDOOFUS
281Programming error.
282.El
283.Sh SEE ALSO
284.Xr example 1 ,
285.Xr example 4 ,
286.Xr mdoc 7 ,
287.Xr example 9
288.Rs
289.%A "A. B. Author"
290.%T "Example RFC Title"
291.%O RFC0000
292.Re
293.Rs
294.%A "A. B. Author"
295.%B "Example Book Title"
296.%O ISBN-0-000-00000-0
297.Re
298.Rs
299.%A "A. B. Author"
300.%D "January 1997"
301.%J "Example Journal Name"
302.%T "Example Article Title"
303.Re
304.Sh STANDARDS
305If the function conforms to some standard, such as
306.St -p1003.1-2004
307or
308.St -isoC-99 ,
309it should be noted here.
310.Sh HISTORY
311The
312.Nm
313manual page example first appeared in
314.Fx 2.2 .
315.Pp
316Some other common
317.Sx HISTORY
318section examples are:
319.Pp
320The
321.Nm
322manual page example first appeared in
323.Bx 4.4 .
324.Pp
325The
326.Nm
327manual page example first appeared in
328.At v6 .
329.Sh AUTHORS
330This
331manual page was written by
332.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
333.Sh BUGS
334The actual code for this function is vaporware.
335