|
|
HP-UX Reference Volume 3 of 5 > iioctl(2) |
|
NAMEioctl — control device DESCRIPTIONioctl() performs a variety of functions on character special files (devices), or regular files and directories on VxFS file systems. The write-ups of various devices in Section (7) discuss how ioctl() applies to them. The type of arg is dependent on the specific ioctl() call, as described in Section (7). request is made up of several fields which encode the size and direction of the argument (referenced by arg), as well as the desired command. An enumeration of the request fields are:
When both IOC_IN and IOC_OUT are zero, it can be assumed that request is not encoded for size and direction, for compatibility purposes. Requests that do not require any data to be passed and requests that use arg as a value (as opposed to a pointer), have the IOC_IN bit set to one and the IOCSIZE_MASK field set to zero. The following macros are used to create the request argument. x and y are concatenated ((x<<8) | y) to form IOCCMD and shifted into the proper location according to IOCCMD_MASK. t is the type (e.g. struct hpib_cmd) of the actual argument that the request references, and its size is taken and shifted into the appropriate place according to IOCSIZE_MASK.
Note: any data structure referenced by arg must not contain any pointers. RETURN VALUEIf an error has occurred, a value of -1 is returned and errno is set to indicate the error. ioctl() fails if one or more of the following are true: IOC_OUT is ignored if an error occurs.
WARNINGSCheck all references to signal(5) for appropriateness on systems that support sigvector(2). sigvector(2) can affect the behavior described on this page. |
|