[0m


IOCTL(2)	    UNIX Programmer's Manual		 IOCTL(2)



[1mNAME
     [0mioctl - control device

[1mSYNOPSIS
     #include <sys/ioctl.h>

     ioctl(d, request, argp)
     int d;
     unsigned long request;
     char *argp;

DESCRIPTION
     [0m_I_o_c_t_l performs a variety of functions on open descriptors.
     In particular, many operating characteristics of character
     special files (e.g. terminals) may be controlled with _i_o_c_t_l
     requests.	The writeups of various devices in section 4 dis-
     cuss how _i_o_c_t_l applies to them.

     An  ioctl _r_e_q_u_e_s_t has encoded in it whether the argument is
     an "in" parameter or "out" parameter, and the size of the
     argument _a_r_g_p in bytes.  Macros and defines used in specify-
     ing an ioctl _r_e_q_u_e_s_t are located in the file <_s_y_s/_i_o_c_t_l._h>.

[1mRETURN VALUE
     [0mIf an error has occurred, a value of -1 is returned and
     _e_r_r_n_o is set to indicate the error.

[1mERRORS
     [0m_I_o_c_t_l will fail if one or more of the following are true:

     [EBADF]	    _D is not a valid descriptor.

     [ENOTTY]	    _D is not associated with a character special
		    device.

     [ENOTTY]	    The specified request does not apply to the
		    kind of object that the descriptor _d refer-
		    ences.

     [EINVAL]	    _R_e_q_u_e_s_t or _a_r_g_p is not valid.

[1mSEE ALSO
     [0mexecve(2), fcntl(2), mt(4), tty(4), intro(4N)












Printed 12/11/92    Revision 1.2 of 19/10/88			1



[0m