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

vn_open Entry Point

Purpose

Requests that a file be opened for reading or writing.

Syntax

int vn_open (vp, flag, ext, vinfop, crp)
struct vnode *vp;
int flag;
caddr_t ext;
caddr_t vinfop;
struct ucred *crp;

Parameters

vp Points to the virtual node (v-node) associated with the desired file. The v-node is held for the duration of the open process.
flag Specifies the type of access. Access modes are defined in the /usr/include/sys/fcntl.h file.
Note: The vn_open entry point does not use the FCREAT mode.
ext Points to external data. This parameter is used if the subroutine is opening a device.
vinfop This parameter is not currently used.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vn_open entry point is called to initiate a process access to a v-node and its underlying file system object. The operation of the vn_open entry point varies between virtual file system (VFS) implementations. A successful vn_open entry point must leave a v-node count of at least 1.

The logical file system ensures that the process is not requesting write access (with the FWRITE or FTRUNC mode) to a read-only file system.

Execution Environment

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

Return Values

0 Indicates success.

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.

Related Information

The open subroutine.

The vn_close entry point.

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

List of Virtual File System Operations.


[ Previous | Next | Contents | Home | Search ]