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

vn_create Entry Point

Purpose

Creates a new file.

Syntax

int vn_create (dp, vpp, flag, pname, mode, vinfop, crp)
struct vnode *dp;
struct vnode **vpp;
int flag;
char *pname;
int mode;
caddr_t *vinfop;
struct ucred *crp;

Parameters

dp Points to the virtual node (v-node) of the parent directory.
vpp Points to the place in which the pointer to a v-node for the newly created file is returned.
flag Specifies an integer flag word. The vn_create entry point uses this parameter to open the file.
pname Points to the name of the new file.
mode Specifies the mode for the new file.
vinfop This parameter is unused.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vn_create entry point is invoked by the logical file system to create a regular (v-node type VREG) file in the directory specified by the dp parameter. (Other v-node operations create directories and special files.) Virtual node types are defined in the /usr/include/sys/vnode.h file. The v-node of the parent directory is held during the processing of the vn_create entry point.

To create a file, the vn_create entry point does the following:

Execution Environment

The vn_create 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 vn_lookup 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.

Special Files Overview.


[ Previous | Next | Contents | Home | Search ]