source: trunk/minix/man/man2/ioctl.2@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.6 KB
Line 
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
10ioctl \- control device
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/types.h>
15#include <sys/ioctl.h>
16
17.ta +54n
18int ioctl(int \fId\fP, int \fIrequest\fP, void *\fIargp\fP) (Minix)
19int 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
25performs a variety of functions
26on open descriptors. In particular, many operating
27characteristics of character special files (e.g. terminals)
28may be controlled with
29.B ioctl
30requests.
31The writeups of various devices in section 4 discuss how
32.B ioctl
33applies to them.
34.PP
35An ioctl
36.I request
37has encoded in it whether the argument is an \*(lqin\*(rq parameter
38or \*(lqout\*(rq parameter, and the size of the argument \fIargp\fP in bytes.
39Macros and defines used in specifying an ioctl
40.I request
41are located in the file
42.IR <sys/ioctl.h> .
43.SH "RETURN VALUE
44If an error has occurred, a value of \-1 is returned and
45.B errno
46is set to indicate the error.
47.SH ERRORS
48.B Ioctl
49will 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
56special device.
57.TP 15
58[ENOTTY]
59The specified request does not apply to the kind
60of 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).
Note: See TracBrowser for help on using the repository browser.