IOCTL.2
上传用户:jnzhq888
上传日期:2007-01-18
资源大小:51694k
文件大小:2k
- ." 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 fIdfP, int fIrequestfP, void *fIargpfP) (Minix)
- int ioctl(int fIdfP, ioreq_t fIrequestfP, void *fIargpfP) (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 fIargpfP 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]
- fIDfP is not a valid descriptor.
- .TP 15
- [ENOTTY]
- fIDfP 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 fIdfP references.
- .TP 15
- [EINVAL]
- fIRequestfP or fIargpfP is not valid.
- .SH "SEE ALSO"
- .BR execve (2),
- .BR fcntl (2),
- .BR mt (4),
- .BR tty (4),
- .BR intro (4).