Skip to content

Commit 636adf3

Browse files
committed
man: describe how Ropenfd sends the file descriptor
1 parent b3ca0e9 commit 636adf3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

man/man9/openfd.9p

+23-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ transaction,
2828
is considered by the client to have been clunked
2929
and can be reused.
3030
.PP
31-
The returned Unix file descriptor is one end of a Unix domain socket.
32-
A proxy process at the other end transfers data between
31+
In addition to sending a
32+
.B Ropenfd
33+
response, the server also sends an out-of-band control-message
34+
containing a Unix file descriptor (an
35+
.BR SCM_RIGHTS
36+
message; this requires that the 9P transport be a Unix domain socket).
37+
This returned Unix file descriptor is one end of a Unix domain socket;
38+
a proxy process at the other end transfers data between
3339
the socket and the 9P server.
3440
Because it is a socket, errors on reads and writes are discarded.
3541
.PP
@@ -50,3 +56,18 @@ message.
5056
generates an
5157
.B openfd
5258
message.
59+
.SH BUGS
60+
The returned
61+
.I unixfd
62+
field nominally refers to the file descriptor that has been sent in
63+
the control-message. However, the file descriptor in the client
64+
process will not necessarily have the same number as in the server
65+
process, so clients should ignore this field and instead trust the
66+
file descriptor number from the control-message.
67+
.PP
68+
.MR 9pclient (3)
69+
accomplishes this by having
70+
.B \*9/src/lib9pclient/fs.c
71+
.IR _fsrecv
72+
rewrite the field to the value from the control-message before
73+
returning the R-message.

0 commit comments

Comments
 (0)