vnop_ioctl Entry Point

Purpose

Requests I/O control operations on special files.

Syntax

int vnop_ioctl (vp, cmd, arg, flags, ext, crp)
struct vnode * vp;
int  cmd;
caddr_t  arg;
int  flags,  ext;
struct ucred * crp;

Parameters

Item Description
vp Points to the virtual node (v-node) on which to perform the operation.
cmd Identifies the specific command. Common operations for the ioctl subroutine are defined in the /usr/include/sys/ioctl.h file. The file system implementation can define other ioctl operations.
arg Defines a command-specific argument. This parameter can be a single word or a pointer to an argument (or result structure).
flags Identifies flags from the open file structure.
ext Specifies the extended parameter passed by the ioctl subroutine. The ioctl subroutine always sets the ext parameter to 0.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vnop_ioctl entry point is used by the logical file system to perform miscellaneous operations on special files. If the file system supports special files, the information is passed down to the ddioctl entry point of the device driver associated with the given v-node.

Execution Environment

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

Return Values

Item Description
0 Indicates success.

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure. A valid value includes:

Item Description
EINVAL Indicates the file system does not support the entry point.