fp_ioctlx Kernel Service

Purpose

Issues a control command to an open device.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <fcntl.h>

int fp_ioctlx (fp, cmd, arg, ext, flags, retval)
struct file *fp;
unsigned long cmd;
caddr_t arg;
ext_t ext;
unsigned long flags;
long *retval;

Description

The fp_ioctlx kernel service is an internal interface to the function provided by the ioctl subroutine.

The fp_ioctlx kernel service issues a control command to an open device. Some drivers need the return value that is returned by the kernel service if there is no error. This value is not available through the fp_ioctl kernel service. The fp_ioctlx kernel service allows this data to be passed.

Parameters

Item Description
fp Points to a file structure returned by the fp_open or fp_opendev kernel service.
cmd Specifies the specific control command requested.
arg Indicates the data required for the command.
ext Specifies an extension argument required by some device drivers. Its content, form, and use are determined by the individual driver.
flags Indicates the address space of arg parameter. If the arg value is in kernel address space, flags should be specified as FKERNEL. Otherwise, it should be zero (drivers pass data that is in user space).
retval Points to the location where the return value will be stored on successful return from the call.

Execution Environment

The fp_ioctlx kernel service can be called only from the process environment.

Return Values

Upon successful completion, the fp_ioctlx kernel service returns 0. If unsuccessful, one of the values from the /usr/include/sys/errno.h file is returned. The ioctl subroutine contains valid errno values. This value will be stored in the retval parameter.