IOCTL

Section: (9)
Updated: 29 May 2003
Index Return to Main Contents

 

NAME

ioctl - driver can respond to ioctls  

SYNOPSIS

int ioctl (struct scsi_device * sdp, int cmd, void * arg);  

ARGUMENTS

sdp
device that ioctl was issued for
cmd
ioctl number
arg
pointer to read or write data from. Since it points to user space, should use appropriate kernel functions (e.g. copy_from_user ). In the Unix style this argument can also be viewed as an unsigned long.
 

DESCRIPTION

Returns negative ``errno'' value when there is a problem. 0 or a positive value indicates success and is returned to the user space.  

REQUIRED

no  

LOCKS

none  

NOTES

The SCSI subsystem uses a ``trickle down'' ioctl model. The user issues an ioctl against an upper level driver (e.g. /dev/sdc) and if the upper level driver doesn't recognize the 'cmd' then it is passed to the SCSI mid level. If the SCSI mid level does not recognize it, then the LLD that controls the device receives the ioctl. According to recent Unix standards unsupported ioctl 'cmd' numbers should return -ENOTTY. However the mid level returns -EINVAL for unrecognized 'cmd' numbers when this function is not supplied by the driver. Unfortunately some applications expect -EINVAL and react badly when -ENOTTY is returned; stick with -EINVAL.  

DEFINED IN

LLD  

ABOUT THIS DOCUMENT

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

If you have comments on the formatting of this manpage, then please contact Michael Still (mikal@stillhq.com).

This documentation was generated with kernel version 2.5.70.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
REQUIRED
LOCKS
NOTES
DEFINED IN
ABOUT THIS DOCUMENT

This document was created by man2html, using the manual pages.
Time: 11:26:08 GMT, May 29, 2003