fcntl: Control open file descriptors

This function controls the open file descriptors.

Note: This is a standard C/C++ library function that is supported on the z/TPF system. The following information describes only z/TPF support. For more information about standard C and C++ library functions, see the following websites:

Last updated

  • Changed for PUT11 (information only; no code change).

  • Changed for PUT04.
  • Changed for PUT00.

Programming considerations

The following lists the z/TPF deviations from POSIX for this function:
  • The z/TPF collection support file system (TFS) does not support the pid_t l_pid field of the flock structure.
  • The z/TPF collection support file system (TFS) does not accept the SEEK_CUR and SEEK_END values for this field.
  • The z/TPF collection support file system (TFS) does not support read or shared locks.
  • To allow a reader to get exclusive access to a z/TPF collection support file system (TFS) file, the requirement to have write access to the file when requesting a write lock is not enforced.
  • The z/TPF collection support file system (TFS) does not support the F_GETLK and F_SETLK action parameter values.
  • The only file locking supported by the z/TPF collection support file system (TFS) is a blocking exclusive lock over an entire file. The following fcntl function options are not supported:
    • Locking a range of bytes in a file (other than the entire file)
    • Attempting to lock without blocking
    • Getting a shared lock
    • Querying locks.
  • When using the fcntl function for socket descriptors, only the F_GETLK and F_SETLK action parameter values are supported, returning only the status bit O_NONBLOCK setting.