Files
plan9port/man/man9/openfd.9p
Dmitri Vereshchagin 10564b1175 tmac/tmac.an: define .MR in a groff compatible way
groff 1.23.0 added .MR to its -man macro package.  The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020."  From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.

Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.

Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized.  groff's .MR does not.  This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
2025-07-27 09:58:50 -04:00

61 lines
1.0 KiB
Plaintext

.TH OPENFD 9P
.SH NAME
openfd \- prepare a fid for I/O using a file descriptor
.SH SYNOPSIS
.ta \w'\fLTopenfd 'u
.IR size [4]
.B Topenfd
.IR tag [2]
.IR fid [4]
.IR mode [1]
.br
.IR size [4]
.B Ropenfd
.IR tag [2]
.IR qid [13]
.IR iounit [4]
.IR unixfd [4]
.SH DESCRIPTION
The
.I openfd
request behaves like open, except that it prepares and returns
a Unix file descriptor corresponding to the opened fid.
.PP
After a successful
.I open
transaction,
.I fid
is considered by the client to have been clunked
and can be reused.
.PP
The returned Unix file descriptor is one end of a Unix pipe.
A proxy process at the other end transfers data between
the pipe and the 9P server.
Because it is a pipe, errors on reads and writes are discarded
and
.I mode
must be
.B OREAD
or
.BR OWRITE ;
it cannot be
.BR ORDWR .
.PP
.I Openfd
is implemented by
.MR 9pserve 4 .
9P servers that post their services using
.MR 9pserve 4
(or indirectly via
.MR post9pservice 3 )
will never see a
.B Topenfd
message.
.SH ENTRY POINTS
.I Fsopenfd
(see
.MR 9pclient 3 )
generates an
.B openfd
message.