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