1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
26 HREF="net-common-tcpip-manpages-getsockopt.html"><LINK
29 HREF="net-common-tcpip-manpages-poll.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-getsockopt.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-poll.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-IOCTL">ioctl</H1
94 >IOCTL(2) System Calls Manual IOCTL(2)
97 ioctl - control device
100 #include <sys/ioctl.h>
103 ioctl(int d, unsigned long request, ...);
106 The ioctl() function manipulates the underlying device parameters of spe-
107 cial files. In particular, many operating characteristics of character
108 special files (e.g., terminals) may be controlled with ioctl() requests.
110 The argument d must be an open file descriptor. The third argument is
111 called arg and contains additional information needed by this device to
112 perform the requested function. arg is either an int or a pointer to a
113 device-specific data structure, depending upon the given request.
115 An ioctl request has encoded in it whether the argument is an ``in''
116 parameter or ``out'' parameter, and the size of the third argument (arg)
117 in bytes. Macros and defines used in specifying an ioctl request are
118 located in the file <sys/ioctl.h>.
121 If an error has occurred, a value of -1 is returned and errno is set to
125 ioctl() will fail if:
127 [EBADF] d is not a valid descriptor.
129 [ENOTTY] d is not associated with a character special device.
131 [ENOTTY] The specified request does not apply to the kind of
132 object that the descriptor d references.
134 [EINVAL] request or arg is not valid.
136 [EFAULT] arg points outside the process's allocated address
140 cdio(1), chio(1), mt(1), execve(2), fcntl(2), intro(4), tty(4)
143 An ioctl() function call appeared in Version 7 AT&T UNIX.
145 BSD December 11, 1993 BSD
156 SUMMARY="Footer navigation table"
167 HREF="net-common-tcpip-manpages-getsockopt.html"
185 HREF="net-common-tcpip-manpages-poll.html"
201 HREF="tcpip-library-reference.html"