>>-f_closfd--fd--fd2-------------------------------------------><
Function
f_closfd invokes the fcntl callable service to close a range of file descriptors.
Parameters
- fd
- The file descriptor (a number) for a file. This is the first
file descriptor to be closed.
- fd2
- The file descriptor (a number) for a file, which must be greater
than or equal to fd. If a -1 is specified
for fd2, all file descriptors greater than or equal to fd are
closed.
Usage notes
- A process can use f_closfd to close a range of file descriptors.
fd2 must be greater than or equal to fd, or it
can also be -1, which indicates that all file descriptors
greater than or equal to fd are to be closed.
- Use of f_closfd is meant to be consistent with the close
callable service. You cannot close file descriptors that could not
also be closed using the close service.
- When a file descriptor cannot be closed, it is considered an error,
but the request continues with the next file descriptor in the range.
File descriptors that are not in use are ignored.
Example
In the following example, assume that
fd and
fd2 were
assigned values earlier in the exec:
"f_closfd" fd fd2