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