Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ioctl(2) [minix man page]

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)						      BSD System Calls Manual							  IOCTL(2)

NAME
ioctl -- control device SYNOPSIS
#include <sys/ioctl.h> int ioctl(int fildes, unsigned long 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 fildes must be an open file descriptor. 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 VALUES
If an error has occurred, a value of -1 is returned and errno is set to indicate the error. ERRORS
Ioctl() will fail if: [EBADF] fildes is not a valid descriptor. [EINVAL] Request or argp is not valid. [ENOTTY] fildes is not associated with a character special device. [ENOTTY] The specified request does not apply to the kind of object that the descriptor fildes references. SEE ALSO
cdio(1), chio(1), mt(1), execve(2), fcntl(2), intro(4), tty(4) HISTORY
An ioctl() function call appeared in Version 7 AT&T UNIX. 4th Berkeley Distribution December 11, 1993 4th Berkeley Distribution
Man Page

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Warning message ioctl

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)
Discussion started by: Diana
1 Replies

2. Solaris

ioctl() fails to get window size from console login

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)
Discussion started by: diganta
2 Replies

3. UNIX for Dummies Questions & Answers

Using Sudo

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)
Discussion started by: ambika
2 Replies

4. UNIX for Dummies Questions & Answers

Inappropriate ioctl for device

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)
Discussion started by: spoonman
0 Replies

5. UNIX for Dummies Questions & Answers

Inappropriate ioctl for device

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)
Discussion started by: steelrose
4 Replies

6. Solaris

Inappropriate ioctl for device, format error

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)
Discussion started by: spoonman
2 Replies

7. UNIX for Advanced & Expert Users

ioctl() system call on Linux-i386

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)
Discussion started by: aigoia
1 Replies

8. Programming

Using ioctl to read mice inputs

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)
Discussion started by: maverick_
2 Replies

9. UNIX for Advanced & Expert Users

ioctl : strace

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)
Discussion started by: angad.makkar
1 Replies

10. Solaris

ictl error - ENOTTY

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)
Discussion started by: ocramas
1 Replies