|
|
1.1 ! root 1: ! 2: ! 3: ioctl() COHERENT System Call ioctl() ! 4: ! 5: ! 6: ! 7: ! 8: Device-dependent control ! 9: ! 10: iiooccttll(_f_d, _c_o_m_m_a_n_d, _i_n_f_o) ! 11: iinntt _f_d, _c_o_m_m_a_n_d; ! 12: cchhaarr *_i_n_f_o; ! 13: ! 14: ioctl provides direct interaction with a device driver. Possible ! 15: uses include setting or retrieving parameters for devices (line ! 16: printers, communications lines, terminals) and non-standard ! 17: spacing operations for tape drives. ! 18: ! 19: ioctl acts upon a block special file or a character special file ! 20: associated with the already open file descriptor fd. command ! 21: points to the specific request. A system header file defines ! 22: symbolic command parameters for each device type. For example, ! 23: sgtty.h defines commands for terminals and mtioctl.h defines com- ! 24: mands for magnetic tape drives. Using the symbolic command ! 25: definitions from the header files promotes device independence ! 26: within each device type. The entry for device drivers names ! 27: other sections that detail specific devices. ! 28: ! 29: info passes a buffer of information (defined by structures in the ! 30: appropriate header files) to the driver. For any command not ! 31: needing additional information, this argument should be NULL. ! 32: ! 33: Some ioctl requests work on all files, and are not passed to any ! 34: driver. The commands FIOCLEX and FIONCLEX enable and disable ! 35: closing of the given file descriptor when an exec call completes. ! 36: ! 37: ***** Files ***** ! 38: ! 39: <sgtty.h> ! 40: <lpioctl.h> ! 41: <mtioctl.h> ! 42: ! 43: ***** See Also ***** ! 44: ! 45: COHERENT system calls, exec, getty, open(), read(), stty, write() ! 46: ! 47: ***** Diagnostics ***** ! 48: ! 49: ioctl returns -1 on errors, such as a bad file descriptor. ! 50: Because the call is device dependent, almost any other error ! 51: could be returned. ! 52: ! 53: ***** Notes ***** ! 54: ! 55: The type of the info argument to ioctl is declared as char * ! 56: mainly for portability reasons. In most cases, the actual argu- ! 57: ment type will be something like struct sgttyb *, depending on ! 58: the particular device and command. The actual argument should be ! 59: cast to type char * to ensure cross-machine portability. ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.