z/OS UNIX System Services File System Interface Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Reading and writing

z/OS UNIX System Services File System Interface Reference
SA23-2285-00

The five variations on read/write—vn_rdwr, vn_readwritev, vn_sndrcv, vn_sndtorcvfm, and vn_srmsg—are all UIO operations, and are described in Reading from and writing to files.

The UIO contains additional fields for the socket-specific buffers that are used on some of these calls.

During these read/write calls, the PFS must:
  1. Move the data using Move With Source Key or Move With Destination Key, as appropriate. The osi_copyin and osi_copyout services can be used to move data areas between the user and kernel address spaces. The osi_uiomove service can be used to move data areas based on the UIO structure for vn_rdwr and vn_readwritev.
  2. Return the number of bytes that were transferred.

Serialization: All five operations are called with an exclusive latch for writing. All five operations are called with an exclusive latch for reading, with the exception of vn_rdwr and vn_readwritev, which may be called with a shared latch for reading if the PFS has specified shared read support for the file being read. The LFS defaults to exclusive latching for both reading and writing, to help the PFS implement the POSIX semantics of atomic operations and immediate visibility to all other processes. This latching can be turned off if it is not needed by the PFS. Refer to LFS-PFS control block serialization for more details.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014