|MANDOCD(8)||System Manager's Manual||MANDOCD(8)|
mandocd — server
process to format manual pages in batch mode
mandocd utility formats many manual
pages without requiring
exec(3) overhead in
between. It does not require listing all the manuals to be formatted on the
command line, and it supports writing each formatted manual to its own file
This server requires that a connected UNIX domain
already present at
Consequently, it cannot be started from the
sh(1) command line
because the shell cannot supply such a socket. Typically, the socket is
created by the parent process using
mandocd. The parent process will pass the file
descriptor number as an argument to
as a decimal ASCII-encoded integer. See
catman(8) for a typical
implementation of a parent process.
mandocd loops reading one-byte messages
from the file descriptor number socket_fd. It ignores
the byte read and only uses the out-of-band auxiliary struct
cmsghdr control data, typically supplied by the calling process using
The parent process is expected to pass three file descriptors with each
dummy byte. The first one is used for
man(7) input, the second one for
formatted output, and the third one for error output.
The options are as follows:
Osand for the man(7)
html; see mandoc(1). In
htmloutput mode, the
fragmentoutput option is implied. Other output options are not supported.
After exhausting one input file descriptor, all three file descriptors are closed before reading the next dummy byte and control message.
When a zero-byte message is read, when the
socket_fd is closed by the parent process, or when an
mandocd utility exits 0 on
success, and >0 if an error occurs.
A zero-byte message or a closed socket_fd is considered success. Possible errors include:
SOL_SOCKET, a cmsg_type that differs from
SCM_RIGHTS, or a cmsg_len that is not three times the size of an int
Except for memory exhaustion and similar system-level failures,
parsing and formatting errors do not cause
to return an error exit status. Even after severe parsing errors,
mandocd will simply accept and process the next
input file descriptor.
mandocd utility appeared in version
1.14.1 or the
If the parsed manual pages contain
to be started with the current working directory set to the root of the
manual page tree. Avoid starting it in directories that contain secret files
in any subdirectories, in particular in the user starting it has read access
to these secret files.
|March 18, 2017||OpenBSD 6.7|