74 lines
2.5 KiB
HTML
74 lines
2.5 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>ioctl(2)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>ioctl(2)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
ioctl - control device
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><sys/types.h></STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><sys/ioctl.h></STRONG>
|
|
|
|
<STRONG>int</STRONG> <STRONG>ioctl(int</STRONG> <EM>d</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>request</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>argp</EM><STRONG>)</STRONG> <STRONG>(Minix)</STRONG>
|
|
<STRONG>int</STRONG> <STRONG>ioctl(int</STRONG> <EM>d</EM><STRONG>,</STRONG> <STRONG>ioreq_t</STRONG> <EM>request</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>argp</EM><STRONG>)</STRONG> <STRONG>(Minix</STRONG>-<STRONG>vmd)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Ioctl</STRONG> performs a variety of functions on open descriptors. In
|
|
particular, many operating characteristics of character special files
|
|
(e.g. terminals) may be controlled with <STRONG>ioctl</STRONG> requests. The writeups of
|
|
various devices in section 4 discuss how <STRONG>ioctl</STRONG> applies to them.
|
|
|
|
An ioctl <EM>request</EM> has encoded in it whether the argument is an "in"
|
|
parameter or "out" parameter, and the size of the argument <EM>argp</EM> in bytes.
|
|
Macros and defines used in specifying an ioctl <EM>request</EM> are located in the
|
|
file <<EM>sys</EM>/<EM>ioctl</EM>.<EM>h</EM>>.
|
|
|
|
|
|
</PRE>
|
|
<H2>RETURN VALUE</H2><PRE>
|
|
If an error has occurred, a value of -1 is returned and <STRONG>errno</STRONG> is set to
|
|
indicate the error.
|
|
|
|
|
|
</PRE>
|
|
<H2>ERRORS</H2><PRE>
|
|
<STRONG>Ioctl</STRONG> will fail if one or more of the following are true:
|
|
|
|
[EBADF] <EM>D</EM> is not a valid descriptor.
|
|
|
|
[ENOTTY] <EM>D</EM> is not associated with a character special device.
|
|
|
|
[ENOTTY] The specified request does not apply to the kind of object
|
|
that the descriptor <EM>d</EM> references.
|
|
|
|
[EINVAL] <EM>Request</EM> or <EM>argp</EM> is not valid.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man2/execve.2.html">execve(2)</A></STRONG>, <STRONG><A HREF="../man2/fcntl.2.html">fcntl(2)</A></STRONG>, <STRONG><A HREF="../man4/mt.4.html">mt(4)</A></STRONG>, <STRONG><A HREF="../man4/tty.4.html">tty(4)</A></STRONG>, <STRONG><A HREF="../man4/intro.4.html">intro(4)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|