[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

vn_rdwr Entry Point

Purpose

Requests file I/O.

Syntax

int vn_rdwr (vp, op, flags, uiop, ext, vinfo, vattrp, crp)
struct vnode *vp;
enum uio_rw op;
int flags;
struct uio *uiop;
int ext;
caddr_t vinfo;
struct vattr *vattrp;
struct ucred *crp;

Parameters

vp Points to the virtual node (v-node) of the file.
op Specifies a number that indicates a read or write operation. This parameter has a value of either UIO_READ or UIO_WRITE. These values are found in the /usr/include/sys/uio.h file.
flags Identifies flags from the open file structure.
uiop Points to a uio structure. This structure describes the count, data buffer, and other I/O information.
ext Provides an extension for special purposes. Its use and meaning are specific to virtual file systems, and it is usually ignored except for devices.
vinfo This parameter is currently not used.
vattrp Points to a vattr structure. If this pointer is NULL, no action is required of the file system implementation. If it is not NULL, the attributes of the file specified by the vp parameter are returned at the address passed in the vattrp parameter.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vn_rdwr entry point is used to request that data be read or written from an object represented by a v-node. The vn_rdwr entry point does the indicated data transfer and sets the number of bytes not transferred in the uio_resid field. This field is 0 (zero) on successful completion.

Execution Environment

The vn_rdwr entry point can be called from the process environment only.

Return Values

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure. The vn_rdwr entry point returns an error code if an operation did not transfer all the data requested. The only exception is if an end of file is reached on a read request. In this case, the operation still returns 0.

Related Information

The vn_create entry point, vn_open entry point.

The read subroutine, write subroutine.

The uio structure.

Virtual File System Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes), and Virtual File System Kernel Extensions Overview in AIX Kernel Extensions and Device Support Programming Concepts.

List of Virtual File System Operations.


[ Previous | Next | Contents | Home | Search ]