1997-02-28 10:09:09 +00:00
|
|
|
.\" Copyright (c) [year] [your name]
|
|
|
|
.\" All rights reserved.
|
1997-01-02 20:37:25 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
1997-02-28 10:09:09 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
1997-01-02 20:37:25 +00:00
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 23:32:12 +00:00
|
|
|
.\" $FreeBSD$
|
1997-01-02 20:37:25 +00:00
|
|
|
.\"
|
1997-01-09 06:32:22 +00:00
|
|
|
.\" Note: The date here should be updated whenever a non-trivial
|
|
|
|
.\" change is made to the manual page.
|
1999-12-08 22:15:09 +00:00
|
|
|
.Dd December 8, 1999
|
1997-01-02 20:37:25 +00:00
|
|
|
.Dt EXAMPLE 3
|
2001-04-23 15:15:49 +00:00
|
|
|
.Os
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm example
|
2001-07-18 10:04:34 +00:00
|
|
|
.Nd "example library function manual page"
|
2000-04-23 14:47:26 +00:00
|
|
|
.Sh LIBRARY
|
2001-04-17 12:49:42 +00:00
|
|
|
.\" Note: list of available libraries is available in mdoc(7)
|
2000-04-23 14:47:26 +00:00
|
|
|
.Lb libc
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-07-18 10:04:34 +00:00
|
|
|
.In example.h
|
1997-01-02 20:37:25 +00:00
|
|
|
.Ft int
|
|
|
|
.Fn example "char *ptr" "int mode"
|
|
|
|
.Sh DESCRIPTION
|
2001-07-18 08:51:04 +00:00
|
|
|
This is an example library function manual page for the
|
1997-01-02 20:37:25 +00:00
|
|
|
.Fn example
|
2001-07-18 08:51:04 +00:00
|
|
|
function.
|
|
|
|
It is intended that this example can be used as a template
|
|
|
|
when writing a new manual page.
|
1997-01-02 20:37:25 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn example
|
|
|
|
function takes two arguments:
|
|
|
|
.Fa ptr
|
|
|
|
and
|
|
|
|
.Fa mode .
|
|
|
|
The argument
|
|
|
|
.Fa mode
|
|
|
|
may have one of the following values:
|
2001-07-18 10:04:34 +00:00
|
|
|
.Bl -tag -width ".Dv EXAMPLE_ONE"
|
1997-01-02 20:37:25 +00:00
|
|
|
.It Dv EXAMPLE_ONE
|
|
|
|
First example of a defined variable.
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dv EXAMPLE_ONE
|
|
|
|
is described below.
|
1997-01-02 20:37:25 +00:00
|
|
|
.It Dv EXAMPLE_TWO
|
|
|
|
Second example.
|
|
|
|
.El
|
|
|
|
.Pp
|
2001-07-18 10:04:34 +00:00
|
|
|
The above values are defined in
|
1997-01-02 21:10:30 +00:00
|
|
|
.Aq Pa example.h
|
1997-01-02 20:37:25 +00:00
|
|
|
as follows:
|
|
|
|
.Bd -literal
|
|
|
|
#define EXAMPLE_ONE 1
|
|
|
|
#define EXAMPLE_TWO 2
|
|
|
|
.Ed
|
1999-12-08 22:15:09 +00:00
|
|
|
.Sh IMPLEMENTATION NOTES
|
|
|
|
The
|
|
|
|
.Fn example
|
|
|
|
function is not actually implemented.
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh RETURN VALUES
|
1997-03-19 21:08:48 +00:00
|
|
|
.Rv -std example
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh ENVIRONMENT
|
2001-07-15 08:21:37 +00:00
|
|
|
The
|
1997-01-02 20:37:25 +00:00
|
|
|
.Fn example
|
|
|
|
library function ignores the
|
|
|
|
.Ev EXAMPLE
|
|
|
|
environment variable.
|
|
|
|
.Sh FILES
|
2001-07-18 10:04:34 +00:00
|
|
|
.Bl -tag -width ".Pa /dev/null" -compact
|
1997-01-02 20:37:25 +00:00
|
|
|
.It Pa /dev/null
|
|
|
|
Example of a file in the
|
|
|
|
.Sx FILES
|
|
|
|
section.
|
|
|
|
.El
|
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
None.
|
1999-12-08 22:15:09 +00:00
|
|
|
.Sh COMPATIBILITY
|
|
|
|
The
|
|
|
|
.Fn example
|
|
|
|
function has no known compatibility issues.
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh ERRORS
|
1997-01-09 06:32:22 +00:00
|
|
|
.\" Delete any errno's that are not returned by your
|
|
|
|
.\" function or system call and then tailor the
|
|
|
|
.\" remaining text as needed.
|
1997-01-02 20:37:25 +00:00
|
|
|
.Fn Example
|
|
|
|
will fail if:
|
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EPERM
|
1997-01-09 06:32:22 +00:00
|
|
|
Operation not permitted.
|
|
|
|
.It Bq Er ENOENT
|
|
|
|
No such file or directory.
|
|
|
|
.It Bq Er ESRCH
|
|
|
|
No such process.
|
|
|
|
.It Bq Er EINTR
|
|
|
|
Interrupted system call.
|
|
|
|
.It Bq Er EIO
|
|
|
|
Input/output error.
|
|
|
|
.It Bq Er ENXIO
|
|
|
|
Device not configured.
|
|
|
|
.It Bq Er E2BIG
|
|
|
|
Argument list too long.
|
|
|
|
.It Bq Er ENOEXEC
|
|
|
|
Exec format error.
|
|
|
|
.It Bq Er EBADF
|
|
|
|
Bad file descriptor.
|
|
|
|
.It Bq Er ECHILD
|
|
|
|
No child processes.
|
|
|
|
.It Bq Er EDEADLK
|
|
|
|
Resource deadlock avoided.
|
|
|
|
.It Bq Er ENOMEM
|
|
|
|
Cannot allocate memory.
|
|
|
|
.It Bq Er EACCES
|
|
|
|
Permission denied.
|
|
|
|
.It Bq Er EFAULT
|
|
|
|
Bad address.
|
|
|
|
.It Bq Er ENOTBLK
|
|
|
|
Block device required.
|
|
|
|
.It Bq Er EBUSY
|
|
|
|
Device busy.
|
|
|
|
.It Bq Er EEXIST
|
|
|
|
File exists.
|
|
|
|
.It Bq Er EXDEV
|
|
|
|
Cross-device link.
|
|
|
|
.It Bq Er ENODEV
|
|
|
|
Operation not supported by device.
|
|
|
|
.It Bq Er ENOTDIR
|
|
|
|
Not a directory.
|
|
|
|
.It Bq Er EISDIR
|
|
|
|
Is a directory.
|
|
|
|
.It Bq Er EINVAL
|
|
|
|
Invalid argument.
|
|
|
|
.It Bq Er ENFILE
|
|
|
|
Too many open files in system.
|
|
|
|
.It Bq Er EMFILE
|
|
|
|
Too many open files.
|
|
|
|
.It Bq Er ENOTTY
|
|
|
|
Inappropriate ioctl for device.
|
|
|
|
.It Bq Er ETXTBSY
|
|
|
|
Text file busy.
|
|
|
|
.It Bq Er EFBIG
|
|
|
|
File too large.
|
|
|
|
.It Bq Er ENOSPC
|
|
|
|
No space left on device.
|
|
|
|
.It Bq Er ESPIPE
|
|
|
|
Illegal seek.
|
|
|
|
.It Bq Er EROFS
|
|
|
|
Read-only file system.
|
|
|
|
.It Bq Er EMLINK
|
|
|
|
Too many links.
|
|
|
|
.It Bq Er EPIPE
|
|
|
|
Broken pipe.
|
|
|
|
.It Bq Er EDOM
|
|
|
|
Numerical argument out of domain.
|
|
|
|
.It Bq Er ERANGE
|
|
|
|
Result too large.
|
|
|
|
.It Bq Er EAGAIN
|
|
|
|
Resource temporarily unavailable.
|
|
|
|
.It Bq Er EWOULDBLOCK
|
|
|
|
Operation would block.
|
|
|
|
.It Bq Er EINPROGRESS
|
|
|
|
Operation now in progress.
|
|
|
|
.It Bq Er EALREADY
|
|
|
|
Operation already in progress.
|
|
|
|
.It Bq Er ENOTSOCK
|
|
|
|
Socket operation on non-socket.
|
|
|
|
.It Bq Er EDESTADDRREQ
|
|
|
|
Destination address required.
|
|
|
|
.It Bq Er EMSGSIZE
|
|
|
|
Message too long.
|
|
|
|
.It Bq Er EPROTOTYPE
|
|
|
|
Protocol wrong type for socket.
|
|
|
|
.It Bq Er ENOPROTOOPT
|
|
|
|
Protocol not available.
|
|
|
|
.It Bq Er EPROTONOSUPPORT
|
|
|
|
Protocol not supported.
|
2000-11-22 16:11:48 +00:00
|
|
|
.It Bq Er ESOCKTNOSUPPORT
|
1997-01-09 06:32:22 +00:00
|
|
|
Socket type not supported.
|
|
|
|
.It Bq Er EOPNOTSUPP
|
|
|
|
Operation not supported.
|
|
|
|
.It Bq Er EPFNOSUPPORT
|
|
|
|
Protocol family not supported.
|
2000-11-22 16:11:48 +00:00
|
|
|
.It Bq Er EAFNOSUPPORT
|
1997-01-09 06:32:22 +00:00
|
|
|
Address family not supported by protocol family.
|
|
|
|
.It Bq Er EADDRINUSE
|
|
|
|
Address already in use.
|
|
|
|
.It Bq Er EADDRNOTAVAIL
|
|
|
|
Cannot assign requested address.
|
|
|
|
.It Bq Er ENETDOWN
|
|
|
|
Network is down.
|
|
|
|
.It Bq Er ENETUNREACH
|
|
|
|
Network is unreachable.
|
|
|
|
.It Bq Er ENETRESET
|
|
|
|
Network dropped connection on reset.
|
|
|
|
.It Bq Er ECONNABORTED
|
|
|
|
Software causes connection abort.
|
|
|
|
.It Bq Er ENOBUFS
|
|
|
|
No buffer space available.
|
|
|
|
.It Bq Er EISCONN
|
|
|
|
Socket is already connected.
|
|
|
|
.It Bq Er ENOTCONN
|
|
|
|
Socket is not connected.
|
|
|
|
.It Bq Er ESHUTDOWN
|
|
|
|
Cannot send after socket shutdown.
|
|
|
|
.It Bq Er ETOOMANYREFS
|
2001-07-18 10:04:34 +00:00
|
|
|
Too many references: cannot splice.
|
1997-01-09 06:32:22 +00:00
|
|
|
.It Bq Er ETIMEDOUT
|
|
|
|
Operation timed out.
|
|
|
|
.It Bq Er ECONNREFUSED
|
|
|
|
Connection refused.
|
|
|
|
.It Bq Er ELOOP
|
|
|
|
Too many levels of symbolic links.
|
|
|
|
.It Bq Er ENAMETOOLONG
|
|
|
|
File name too long.
|
|
|
|
.It Bq Er EHOSTDOWN
|
|
|
|
Host is down.
|
|
|
|
.It Bq Er EHOSTUNREACH
|
|
|
|
No route to host.
|
|
|
|
.It Bq Er ENOTEMPTY
|
|
|
|
Directory not empty.
|
|
|
|
.It Bq Er EPROCLIM
|
|
|
|
Too many processes.
|
|
|
|
.It Bq Er EUSERS
|
|
|
|
Too many users.
|
|
|
|
.It Bq Er EDQUOT
|
|
|
|
Disc quota exceeded.
|
|
|
|
.It Bq Er ESTALE
|
|
|
|
Stale NFS file handle.
|
|
|
|
.It Bq Er EREMOTE
|
|
|
|
Too many levels of remote in path.
|
|
|
|
.It Bq Er EBADRPC
|
|
|
|
RPC struct is bad.
|
|
|
|
.It Bq Er ERPCMISMATCH
|
|
|
|
RPC version wrong.
|
|
|
|
.It Bq Er EPROGUNAVAIL
|
|
|
|
RPC program not available.
|
|
|
|
.It Bq Er EPROGMISMATCH
|
|
|
|
Program version wrong.
|
|
|
|
.It Bq Er EPROCUNAVAIL
|
|
|
|
Bad procedure for program.
|
|
|
|
.It Bq Er ENOLCK
|
|
|
|
No locks available.
|
|
|
|
.It Bq Er ENOSYS
|
|
|
|
Function not implemented.
|
|
|
|
.It Bq Er EFTYPE
|
|
|
|
Inappropriate file type or format.
|
|
|
|
.It Bq Er EAUTH
|
|
|
|
Authentication error.
|
|
|
|
.It Bq Er ENEEDAUTH
|
|
|
|
Need authenticator.
|
1997-01-02 20:37:25 +00:00
|
|
|
.El
|
1999-12-08 22:15:09 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr example 1 ,
|
|
|
|
.Xr example 4 ,
|
2001-04-17 12:49:42 +00:00
|
|
|
.Xr mdoc 7
|
1999-12-08 22:15:09 +00:00
|
|
|
.Rs
|
2001-07-18 10:04:34 +00:00
|
|
|
.%A "A. B. Author"
|
|
|
|
.%T "Example RFC Title"
|
1999-12-08 22:15:09 +00:00
|
|
|
.%O RFC0000
|
|
|
|
.Re
|
|
|
|
.Rs
|
2001-07-18 10:04:34 +00:00
|
|
|
.%A "A. B. Author"
|
|
|
|
.%B "Example Book Title"
|
1999-12-08 22:15:09 +00:00
|
|
|
.%O ISBN-0-000-00000-0
|
|
|
|
.Re
|
|
|
|
.Rs
|
2001-07-18 10:04:34 +00:00
|
|
|
.%A "A. B. Author"
|
|
|
|
.%D "January 1997"
|
|
|
|
.%J "Example Journal Name"
|
|
|
|
.%T "Example Article Title"
|
1999-12-08 22:15:09 +00:00
|
|
|
.Re
|
|
|
|
.Sh STANDARDS
|
|
|
|
If the command conforms to some standard, such as
|
|
|
|
.St -p1003.2
|
|
|
|
or
|
2001-02-26 13:23:47 +00:00
|
|
|
.St -isoC ,
|
1999-12-08 22:15:09 +00:00
|
|
|
it should be noted here.
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
manual page example first appeared in
|
1997-02-17 16:39:53 +00:00
|
|
|
.Fx 2.2 .
|
1997-01-09 06:32:22 +00:00
|
|
|
.Pp
|
|
|
|
Some other common
|
|
|
|
.Sx HISTORY
|
|
|
|
section examples are:
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
manual page example first appeared in
|
|
|
|
.Bx 4.4 .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
manual page example first appeared in
|
|
|
|
.At v6 .
|
1998-04-01 06:24:20 +00:00
|
|
|
.Sh AUTHORS
|
1997-01-02 20:37:25 +00:00
|
|
|
This
|
1997-03-20 16:14:21 +00:00
|
|
|
manual page was written by
|
1998-04-01 06:24:20 +00:00
|
|
|
.An Mike Pritchard Aq mpp@FreeBSD.org .
|
1997-01-02 20:37:25 +00:00
|
|
|
.Sh BUGS
|
|
|
|
The actual code for this function is vaporware.
|