<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>ioctl</TITLE
|
>ioctl</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Reference Manual"
|
TITLE="eCos Reference Manual"
|
HREF="ecos-ref.html"><LINK
|
HREF="ecos-ref.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="TCP/IP Library Reference"
|
TITLE="TCP/IP Library Reference"
|
HREF="tcpip-library-reference.html"><LINK
|
HREF="tcpip-library-reference.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="getsockopt"
|
TITLE="getsockopt"
|
HREF="net-common-tcpip-manpages-getsockopt.html"><LINK
|
HREF="net-common-tcpip-manpages-getsockopt.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="poll"
|
TITLE="poll"
|
HREF="net-common-tcpip-manpages-poll.html"></HEAD
|
HREF="net-common-tcpip-manpages-poll.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECT1"
|
CLASS="SECT1"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Reference Manual</TH
|
>eCos Reference Manual</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="net-common-tcpip-manpages-getsockopt.html"
|
HREF="net-common-tcpip-manpages-getsockopt.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
>Chapter 38. TCP/IP Library Reference</TD
|
>Chapter 38. TCP/IP Library Reference</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="net-common-tcpip-manpages-poll.html"
|
HREF="net-common-tcpip-manpages-poll.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><DIV
|
><DIV
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><H1
|
><H1
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><A
|
><A
|
NAME="NET-COMMON-TCPIP-MANPAGES-IOCTL">ioctl</H1
|
NAME="NET-COMMON-TCPIP-MANPAGES-IOCTL">ioctl</H1
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="SCREEN"
|
CLASS="SCREEN"
|
>IOCTL(2) System Calls Manual IOCTL(2)
|
>IOCTL(2) System Calls Manual IOCTL(2)
|
|
|
NAME
|
NAME
|
ioctl - control device
|
ioctl - control device
|
|
|
SYNOPSIS
|
SYNOPSIS
|
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
|
|
int
|
int
|
ioctl(int d, unsigned long request, ...);
|
ioctl(int d, unsigned long request, ...);
|
|
|
DESCRIPTION
|
DESCRIPTION
|
The ioctl() function manipulates the underlying device parameters of spe-
|
The ioctl() function manipulates the underlying device parameters of spe-
|
cial files. In particular, many operating characteristics of character
|
cial files. In particular, many operating characteristics of character
|
special files (e.g., terminals) may be controlled with ioctl() requests.
|
special files (e.g., terminals) may be controlled with ioctl() requests.
|
|
|
The argument d must be an open file descriptor. The third argument is
|
The argument d must be an open file descriptor. The third argument is
|
called arg and contains additional information needed by this device to
|
called arg and contains additional information needed by this device to
|
perform the requested function. arg is either an int or a pointer to a
|
perform the requested function. arg is either an int or a pointer to a
|
device-specific data structure, depending upon the given request.
|
device-specific data structure, depending upon the given request.
|
|
|
An ioctl request has encoded in it whether the argument is an ``in''
|
An ioctl request has encoded in it whether the argument is an ``in''
|
parameter or ``out'' parameter, and the size of the third argument (arg)
|
parameter or ``out'' parameter, and the size of the third argument (arg)
|
in bytes. Macros and defines used in specifying an ioctl request are
|
in bytes. Macros and defines used in specifying an ioctl request are
|
located in the file <sys/ioctl.h>.
|
located in the file <sys/ioctl.h>.
|
|
|
RETURN VALUES
|
RETURN VALUES
|
If an error has occurred, a value of -1 is returned and errno is set to
|
If an error has occurred, a value of -1 is returned and errno is set to
|
indicate the error.
|
indicate the error.
|
|
|
ERRORS
|
ERRORS
|
ioctl() will fail if:
|
ioctl() will fail if:
|
|
|
[EBADF] d is not a valid descriptor.
|
[EBADF] d is not a valid descriptor.
|
|
|
[ENOTTY] d is not associated with a character special device.
|
[ENOTTY] d is not associated with a character special device.
|
|
|
[ENOTTY] The specified request does not apply to the kind of
|
[ENOTTY] The specified request does not apply to the kind of
|
object that the descriptor d references.
|
object that the descriptor d references.
|
|
|
[EINVAL] request or arg is not valid.
|
[EINVAL] request or arg is not valid.
|
|
|
[EFAULT] arg points outside the process's allocated address
|
[EFAULT] arg points outside the process's allocated address
|
space.
|
space.
|
|
|
SEE ALSO
|
SEE ALSO
|
cdio(1), chio(1), mt(1), execve(2), fcntl(2), intro(4), tty(4)
|
cdio(1), chio(1), mt(1), execve(2), fcntl(2), intro(4), tty(4)
|
|
|
HISTORY
|
HISTORY
|
An ioctl() function call appeared in Version 7 AT&T UNIX.
|
An ioctl() function call appeared in Version 7 AT&T UNIX.
|
|
|
BSD December 11, 1993 BSD
|
BSD December 11, 1993 BSD
|
</PRE
|
</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="net-common-tcpip-manpages-getsockopt.html"
|
HREF="net-common-tcpip-manpages-getsockopt.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-ref.html"
|
HREF="ecos-ref.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="net-common-tcpip-manpages-poll.html"
|
HREF="net-common-tcpip-manpages-poll.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>getsockopt</TD
|
>getsockopt</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="tcpip-library-reference.html"
|
HREF="tcpip-library-reference.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>poll</TD
|
>poll</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|