1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 1991 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28 /* All Rights Reserved */ 29 30 #ifndef _SYS_IOCTL_H 31 #define _SYS_IOCTL_H 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /* 38 * There are some inherent problems in having a single file 39 * ioctl.h, with both System V and BSD flags. Introducing 40 * BSD flags into this file creates compilation problems 41 * with flags such as ECHO, NL1 etc., if termio.h and ioctl.h 42 * are included by the same file. Since these two files can 43 * be only included by System V applications, /usr/inclule/sys/ioctl.h 44 * will be System V mode and all the BSD flags will be turned off 45 * using #ifdef BSD_COMP. This file will also exist in 46 * /usr/ucbinclude/sys/ioctl.h for BSD applications but without the 47 * BSD flags turned off. System V appliactions can use ioctl.h without 48 * any changes, System V applications requiring BSD flags should 49 * -D BSD_COMP when compiling (and be warned about the common 50 * flags between System V and BSD) and BSD applications should 51 * use /usr/ucbinclude/sys/ioctl.h. 52 * 53 */ 54 55 #define IOCTYPE 0xff00 56 57 #define LIOC ('l'<<8) 58 #define LIOCGETP (LIOC|1) 59 #define LIOCSETP (LIOC|2) 60 #define LIOCGETS (LIOC|5) 61 #define LIOCSETS (LIOC|6) 62 63 #define DIOC ('d'<<8) 64 #define DIOCGETC (DIOC|1) 65 #define DIOCGETB (DIOC|2) 66 #define DIOCSETE (DIOC|3) 67 68 /* 69 * While ioctl was at one point only defined in <stropts.h> by POSIX, it was 70 * removed in Issue 8 (2024). We also have traditionally had a definition of 71 * this in <unistd.h>, which is namespaced. We add this here without namespacing 72 * to aid broader portability. 73 */ 74 extern int ioctl(int, int, ...); 75 76 #ifdef __cplusplus 77 } 78 #endif 79 80 /* BSD related defines */ 81 82 #ifdef BSD_COMP 83 84 #include <sys/ttychars.h> 85 #include <sys/ttydev.h> 86 #include <sys/ttold.h> 87 88 #ifdef __cplusplus 89 extern "C" { 90 #endif 91 92 #define TANDEM O_TANDEM 93 #define CBREAK O_CBREAK 94 #ifndef _SGTTY_H 95 #define LCASE O_LCASE 96 #define ECHO O_ECHO 97 #define CRMOD O_CRMOD 98 #define RAW O_RAW 99 #define ODDP O_ODDP 100 #define EVENP O_EVENP 101 #define ANYP O_ANYP 102 #define NLDELAY O_NLDELAY 103 #define NL0 O_NL0 104 #define NL1 O_NL1 105 #define NL2 O_NL2 106 #define NL3 O_NL3 107 #define TBDELAY O_TBDELAY 108 #define TAB0 O_TAB0 109 #define TAB1 O_TAB1 110 #define TAB2 O_TAB2 111 #define XTABS O_XTABS 112 #define CRDELAY O_CRDELAY 113 #define CR0 O_CR0 114 #define CR1 O_CR1 115 #define CR2 O_CR2 116 #define CR3 O_CR3 117 #define VTDELAY O_VTDELAY 118 #define FF0 O_FF0 119 #define FF1 O_FF1 120 #define BSDELAY O_BSDELAY 121 #define BS0 O_BS0 122 #define BS1 O_BS1 123 #define ALLDELAY O_ALLDELAY 124 #endif /* _SGTTY_H */ 125 #define CRTBS O_CRTBS 126 #define PRTERA O_PRTERA 127 #define CRTERA O_CRTERA 128 #define TILDE O_TILDE 129 #define MDMBUF O_MDMBUF 130 #define LITOUT O_LITOUT 131 #define TOSTOP O_TOSTOP 132 #define FLUSHO O_FLUSHO 133 #define NOHANG O_NOHANG 134 #define L001000 O_L001000 135 #define CRTKIL O_CRTKIL 136 #define PASS8 O_PASS8 137 #define CTLECH O_CTLECH 138 #define PENDIN O_PENDIN 139 #define DECCTQ O_DECCTQ 140 #define NOFLSH O_NOFLSH 141 142 #ifdef __cplusplus 143 } 144 #endif 145 146 #include <sys/filio.h> 147 #include <sys/sockio.h> 148 149 #endif /* BSD_COMP */ 150 151 #endif /* _SYS_IOCTL_H */ 152