open.2: Make it clearer that an FD is an index into the process's FD table

Sometimes people are confused, thinking a file descriptor is just a
number.  To help avoid such confusions, add text highlighting that
a file descriptor is an index to an entry in the process's FD table.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-03-23 11:05:24 +01:00
parent f5270fe6f8
commit 5c3611aa44
1 changed files with 3 additions and 1 deletions

View File

@ -97,7 +97,9 @@ be created by
.PP
The return value of
.BR open ()
is a file descriptor, a small, nonnegative integer that is used
is a file descriptor, a small, nonnegative integer that is an index
to an entry in the process's table of open file descriptors.
The file descriptor is used
in subsequent system calls
.RB ( read "(2), " write "(2), " lseek "(2), " fcntl (2),
etc.) to refer to the open file.