[9] | 1 | .\" Copyright (c) 1980 Regents of the University of California.
|
---|
| 2 | .\" All rights reserved. The Berkeley software License Agreement
|
---|
| 3 | .\" specifies the terms and conditions for redistribution.
|
---|
| 4 | .\"
|
---|
| 5 | .\" @(#)ioctl.2 6.3 (Berkeley) 3/4/86
|
---|
| 6 | .\"
|
---|
| 7 | .TH IOCTL 2 "March 4, 1986"
|
---|
| 8 | .UC 4
|
---|
| 9 | .SH NAME
|
---|
| 10 | ioctl \- control device
|
---|
| 11 | .SH SYNOPSIS
|
---|
| 12 | .nf
|
---|
| 13 | .ft B
|
---|
| 14 | #include <sys/types.h>
|
---|
| 15 | #include <sys/ioctl.h>
|
---|
| 16 |
|
---|
| 17 | .ta +54n
|
---|
| 18 | int ioctl(int \fId\fP, int \fIrequest\fP, void *\fIargp\fP) (Minix)
|
---|
| 19 | int ioctl(int \fId\fP, ioreq_t \fIrequest\fP, void *\fIargp\fP) (Minix-vmd)
|
---|
| 20 | .DT
|
---|
| 21 | .fi
|
---|
| 22 | .ft R
|
---|
| 23 | .SH DESCRIPTION
|
---|
| 24 | .B Ioctl
|
---|
| 25 | performs a variety of functions
|
---|
| 26 | on open descriptors. In particular, many operating
|
---|
| 27 | characteristics of character special files (e.g. terminals)
|
---|
| 28 | may be controlled with
|
---|
| 29 | .B ioctl
|
---|
| 30 | requests.
|
---|
| 31 | The writeups of various devices in section 4 discuss how
|
---|
| 32 | .B ioctl
|
---|
| 33 | applies to them.
|
---|
| 34 | .PP
|
---|
| 35 | An ioctl
|
---|
| 36 | .I request
|
---|
| 37 | has encoded in it whether the argument is an \*(lqin\*(rq parameter
|
---|
| 38 | or \*(lqout\*(rq parameter, and the size of the argument \fIargp\fP in bytes.
|
---|
| 39 | Macros and defines used in specifying an ioctl
|
---|
| 40 | .I request
|
---|
| 41 | are located in the file
|
---|
| 42 | .IR <sys/ioctl.h> .
|
---|
| 43 | .SH "RETURN VALUE
|
---|
| 44 | If an error has occurred, a value of \-1 is returned and
|
---|
| 45 | .B errno
|
---|
| 46 | is set to indicate the error.
|
---|
| 47 | .SH ERRORS
|
---|
| 48 | .B Ioctl
|
---|
| 49 | will fail if one or more of the following are true:
|
---|
| 50 | .TP 15
|
---|
| 51 | [EBADF]
|
---|
| 52 | \fID\fP is not a valid descriptor.
|
---|
| 53 | .TP 15
|
---|
| 54 | [ENOTTY]
|
---|
| 55 | \fID\fP is not associated with a character
|
---|
| 56 | special device.
|
---|
| 57 | .TP 15
|
---|
| 58 | [ENOTTY]
|
---|
| 59 | The specified request does not apply to the kind
|
---|
| 60 | of object that the descriptor \fId\fP references.
|
---|
| 61 | .TP 15
|
---|
| 62 | [EINVAL]
|
---|
| 63 | \fIRequest\fP or \fIargp\fP is not valid.
|
---|
| 64 | .SH "SEE ALSO"
|
---|
| 65 | .BR execve (2),
|
---|
| 66 | .BR fcntl (2),
|
---|
| 67 | .BR mt (4),
|
---|
| 68 | .BR tty (4),
|
---|
| 69 | .BR intro (4).
|
---|