Annotation of researchv10dc/man/man2/ioctl.2, revision 1.1.1.1

1.1       root        1: .TH IOCTL 2
                      2: .CT 2 file_io file_inq_creat
                      3: .SH NAME
                      4: ioctl \(mi miscellaneous control operations
                      5: .SH SYNOPSIS
                      6: .nf
                      7: .B #include <sys/filio.h>
                      8: .PP
                      9: .B int ioctl(fildes, request, param)
                     10: .B void *param;
                     11: .fi
                     12: .SH DESCRIPTION
                     13: .I Ioctl
                     14: performs a variety of
                     15: .I requests
                     16: on open files,
                     17: most applying only to particular device files.
                     18: The writeups of various devices
                     19: in section 4 discuss how
                     20: .I ioctl
                     21: applies to them;
                     22: see
                     23: .IR stream (4)
                     24: in particular
                     25: for operations applying to
                     26: communication devices.
                     27: .PP
                     28: .I Param
                     29: points to a parameter buffer.
                     30: Some
                     31: .I requests
                     32: read data from the buffer;
                     33: others write data to the buffer;
                     34: some do both.
                     35: The buffer's size varies according to the request.
                     36: A few provide meaningful data
                     37: in the return value from
                     38: .I ioctl
                     39: as well;
                     40: others return a conventional value of
                     41: 0 for success,
                     42: \-1 for failure.
                     43: .PP
                     44: Requests for different drivers
                     45: are defined in different header files.
                     46: Two standard calls,
                     47: defined in
                     48: .BR <sys/filio.h> ,
                     49: apply to any open file:
                     50: .IP
                     51: .L
                     52: ioctl(fildes, FIOCLEX, (void *)0);
                     53: .br
                     54: .L
                     55: ioctl(fildes, FIONCLEX, (void *)0);
                     56: .LP
                     57: The first causes the file to be closed automatically upon
                     58: a successful
                     59: .IR exec (2);
                     60: the second causes the file to be left open.
                     61: .SH "SEE ALSO"
                     62: .IR exec (2),
                     63: .IR stream (4)
                     64: .SH DIAGNOSTICS
                     65: .BR EBADF ,
                     66: .BR EFAULT ,
                     67: .BR EIO ,
                     68: .BR ENODEV ,
                     69: .BR ENOTTY
                     70: .SH BUGS
                     71: .I Ioctl
                     72: requests vary among UNIX systems;
                     73: undisciplined use is likely to compromise portability.
                     74: .br
                     75: The size of the parameter buffer
                     76: should be an explicit argument.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.