1 .\" $Id: mandocd.8,v 1.3 2021/09/28 15:41:41 schwarze Exp $
3 .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: September 28 2021 $
22 .Nd server process to format manual pages in batch mode
25 .Op Fl I Cm os Ns = Ns Ar name
31 utility formats many manual pages without requiring
36 It does not require listing all the manuals to be formatted on the
37 command line, and it supports writing each formatted manual to its
40 This server requires that a connected UNIX domain
45 Consequently, it cannot be started from the
47 command line because the shell cannot supply such a socket.
48 Typically, the socket is created by the parent process using
56 The parent process will pass the file descriptor number as an argument to
58 formatted as a decimal ASCII-encoded integer.
61 for a typical implementation of a parent process.
64 loops reading one-byte messages with
66 from the file descriptor number
68 It ignores the byte read and only uses the out-of-band auxiliary
70 control data, typically supplied by the calling process using
72 The parent process is expected to pass three file descriptors
74 The first one is used for
78 input, the second one for formatted output, and the third one
81 The options are as follows:
83 .It Fl I Cm os Ns = Ns Ar name
84 Override the default operating system
108 output option is implied.
109 Other output options are not supported.
112 After exhausting one input file descriptor, all three file descriptors
113 are closed before reading the next dummy byte and control message.
115 When a zero-byte message is read, when the
117 is closed by the parent process,
118 or when an error occurs,
124 A zero-byte message or a closed
126 is considered success.
127 Possible errors include:
130 missing, invalid, or excessive
135 failure, for example due to
138 missing or unexpected control data, in particular a
150 that is not three times the size of an
153 invalid file descriptors passed in the
156 resource exhaustion, in particular
163 Except for memory exhaustion and similar system-level failures,
164 parsing and formatting errors do not cause
166 to return an error exit status.
167 Even after severe parsing errors,
169 will simply accept and process the next input file descriptor.
177 utility appeared in version 1.14.1 of the
182 The concept was designed and implemented by
183 .An Michael Stapelberg Aq Mt stapelberg@debian.org .
186 glue needed to make it a stand-alone process was added by
187 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .
189 If the parsed manual pages contain
194 needs to be started with the current working directory set to the
195 root of the manual page tree.
196 Avoid starting it in directories that contain secret files in any
197 subdirectories, in particular if the user starting it has read
198 access to these secret files.