IOCTL(2) System Calls Manual IOCTL(2)NAME
ioctl - control device
SYNOPSIS
#include <sys/types.h>
#include <sys/ioctl.h>
int ioctl(int d, int request, void *argp) (Minix)
int ioctl(int d, ioreq_t request, void *argp) (Minix-vmd)
DESCRIPTION
Ioctl performs a variety of functions on open descriptors. In particular, many operating characteristics of character special files (e.g.
terminals) may be controlled with ioctl requests. The writeups of various devices in section 4 discuss how ioctl applies to them.
An ioctl request has encoded in it whether the argument is an "in" parameter or "out" parameter, and the size of the argument argp in
bytes. Macros and defines used in specifying an ioctl request are located in the file <sys/ioctl.h>.
RETURN VALUE
If an error has occurred, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Ioctl will fail if one or more of the following are true:
[EBADF] D is not a valid descriptor.
[ENOTTY] D is not associated with a character special device.
[ENOTTY] The specified request does not apply to the kind of object that the descriptor d references.
[EINVAL] Request or argp is not valid.
SEE ALSO execve(2), fcntl(2), mt(4), tty(4), intro(4).
4th Berkeley Distribution March 4, 1986 IOCTL(2)
Check Out this Related Man Page
IOCTL(2) Linux Programmer's Manual IOCTL(2)NAME
ioctl - control device
SYNOPSIS
#include <sys/ioctl.h>
int ioctl(int d, int request, ...);
DESCRIPTION
The ioctl function manipulates the underlying device parameters of special files. In particular, many operating characteristics of charac-
ter special files (e.g. terminals) may be controlled with ioctl requests. The argument d must be an open file descriptor.
The second argument is a device-dependent request code. The third argument is an untyped pointer to memory. It's traditionally char *argp
(from the days before void * was valid C), and will be so named for this discussion.
An ioctl request has encoded in it whether the argument is an in parameter or out parameter, and the size of the argument argp in bytes.
Macros and defines used in specifying an ioctl request are located in the file <sys/ioctl.h>.
RETURN VALUE
Usually, on success zero is returned. A few ioctls use the return value as an output parameter and return a nonnegative value on success.
On error, -1 is returned, and errno is set appropriately.
ERRORS
EBADF d is not a valid descriptor.
EFAULT argp references an inaccessible memory area.
ENOTTY d is not associated with a character special device.
ENOTTY The specified request does not apply to the kind of object that the descriptor d references.
EINVAL Request or argp is not valid.
CONFORMING TO
No single standard. Arguments, returns, and semantics of ioctl(2) vary according to the device driver in question (the call is used as a
catch-all for operations that don't cleanly fit the Unix stream I/O model). See ioctl_list(2) for a list of many of the known ioctl calls.
The ioctl function call appeared in Version 7 AT&T Unix.
SEE ALSO execve(2), fcntl(2), ioctl_list(2), mt(4), sd(4), tty(4)BSD Man Page 2000-09-21 IOCTL(2)
Has anyone over seen this message on bootup? When booting up, I get:
" Warning: lckdioctl: unknown ioctl cmd:5 ".
It scrolls down the screen 5 - 10 times, the I finally get a login. It is also posting to my syslog file. The system came up, but I am still getting the message... (1 Reply)
Hi,
I need to get the console window size for an application, for which I used ioctl() by passing the TIOCGWINSZ parameter. The ioctl() function does not fail (returns non zero), but it could not get the window size (gets 0x0). When I tried to verify the window size by the stty -a command, the... (2 Replies)
Hi All,
I have been trying to use the option -S in sudo for quite some time now but have not been successful. I get the error "Inappropriate ioctl for device" most of the time. Can anyone please tell me how to use this option to pass the password.
Your help is appreciated.
Thanks,
Ambika (2 Replies)
When I try to format a slice in Solaris 10 I get the follow error :confused: :
-bash-3.00# mkfs /dev/dsk/c1d0s5 18877824
Can not determine partition size: Inappropriate ioctl for device
Some format command output:....
AVAILABLE DISK SELECTIONS:
0. c1d0 <DEFAULT cyl 38735 alt 2... (0 Replies)
Hello,
I have a cron entry:
59 23 * * * . $HOME/.profile;mydate=`date '+%Y%m%d'`;mv filename filename_$mydate
Which works fine interactively, but gives me the following error when it runs in cron:
Your "cron" job on servername
. $HOME/.profile;mydate=`date '+
produced the... (4 Replies)
When I try to format a slice in Solaris 10 I get the follow error :
-bash-3.00# mkfs /dev/dsk/c1d0s5 18877824
Can not determine partition size: Inappropriate ioctl for device
Some format command output:....
AVAILABLE DISK SELECTIONS:
0. c1d0 <DEFAULT cyl 38735 alt 2 hd 64 sec 63>... (2 Replies)
Greetings,
Please help me with the following :
Where can I find what means exactly and how to use each of the second
argument of the ioctl() system call in Linux/386 : FIOxxx (file IOCTL
requests), SIOxxx (socket IOCTL requests), TCxxx TIOxxx (terminal
IOCTL requests) ?
... (1 Reply)
I was wondering if its possible to read mouse inputs using ioctl functions somehow ? If it is not too much of trouble can anyone write or even direct me to sample code of ioctl reading someother HID. (2 Replies)
Hi All,
int ioctl(int d, int request, ...);
Can somebody tell me how does ioctl decides the input parameter: "request".
Sometimes, its SNDCTL_TMR_TIMEBASE or TCGETS
or FIONREAD...etc.
What is the pattern??
I am asking this coz my strace returns this: ... (1 Reply)
Hi guys,
I am getting the following error in a running process, I got this from the truss command, after this appears, the process just fails.
ioctl(3, TCGETA, 0xFFBFB334) Err#25 ENOTTY
So, my question is, I think that I know what a ENOTTY is, but from the error, how... (1 Reply)