z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


f_closfd

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-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

  1. 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.
  2. 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.
  3. 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

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014