Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1 | # Generated by h2py from /usr/include/netinet/in.h |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 2 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 3 | # Included from sys/feature_tests.h |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 4 | |
| 5 | # Included from sys/isa_defs.h |
| 6 | _CHAR_ALIGNMENT = 1 |
| 7 | _SHORT_ALIGNMENT = 2 |
| 8 | _INT_ALIGNMENT = 4 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 9 | _LONG_ALIGNMENT = 8 |
| 10 | _LONG_LONG_ALIGNMENT = 8 |
| 11 | _DOUBLE_ALIGNMENT = 8 |
| 12 | _LONG_DOUBLE_ALIGNMENT = 16 |
| 13 | _POINTER_ALIGNMENT = 8 |
| 14 | _MAX_ALIGNMENT = 16 |
| 15 | _ALIGNMENT_REQUIRED = 1 |
| 16 | _CHAR_ALIGNMENT = 1 |
| 17 | _SHORT_ALIGNMENT = 2 |
| 18 | _INT_ALIGNMENT = 4 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 19 | _LONG_ALIGNMENT = 4 |
| 20 | _LONG_LONG_ALIGNMENT = 4 |
| 21 | _DOUBLE_ALIGNMENT = 4 |
| 22 | _LONG_DOUBLE_ALIGNMENT = 4 |
| 23 | _POINTER_ALIGNMENT = 4 |
| 24 | _MAX_ALIGNMENT = 4 |
| 25 | _ALIGNMENT_REQUIRED = 0 |
| 26 | _CHAR_ALIGNMENT = 1 |
| 27 | _SHORT_ALIGNMENT = 2 |
| 28 | _INT_ALIGNMENT = 4 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 29 | _LONG_LONG_ALIGNMENT = 8 |
| 30 | _DOUBLE_ALIGNMENT = 8 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 31 | _ALIGNMENT_REQUIRED = 1 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 32 | _LONG_ALIGNMENT = 4 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 33 | _LONG_DOUBLE_ALIGNMENT = 8 |
| 34 | _POINTER_ALIGNMENT = 4 |
| 35 | _MAX_ALIGNMENT = 8 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 36 | _LONG_ALIGNMENT = 8 |
| 37 | _LONG_DOUBLE_ALIGNMENT = 16 |
| 38 | _POINTER_ALIGNMENT = 8 |
| 39 | _MAX_ALIGNMENT = 16 |
| 40 | _POSIX_C_SOURCE = 1 |
| 41 | _LARGEFILE64_SOURCE = 1 |
| 42 | _LARGEFILE_SOURCE = 1 |
| 43 | _FILE_OFFSET_BITS = 64 |
| 44 | _FILE_OFFSET_BITS = 32 |
| 45 | _POSIX_C_SOURCE = 199506L |
| 46 | _POSIX_PTHREAD_SEMANTICS = 1 |
| 47 | _XOPEN_VERSION = 500 |
| 48 | _XOPEN_VERSION = 4 |
| 49 | _XOPEN_VERSION = 3 |
| 50 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 51 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 52 | # Included from sys/stream.h |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 53 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 54 | # Included from sys/vnode.h |
| 55 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 56 | |
| 57 | # Included from sys/t_lock.h |
| 58 | |
| 59 | # Included from sys/machlock.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 60 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 61 | LOCK_HELD_VALUE = 0xff |
| 62 | def SPIN_LOCK(pl): return ((pl) > ipltospl(LOCK_LEVEL)) |
| 63 | |
| 64 | def LOCK_SAMPLE_INTERVAL(i): return (((i) & 0xff) == 0) |
| 65 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 66 | CLOCK_LEVEL = 10 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 67 | LOCK_LEVEL = 10 |
| 68 | DISP_LEVEL = (LOCK_LEVEL + 1) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 69 | PTR24_LSB = 5 |
| 70 | PTR24_MSB = (PTR24_LSB + 24) |
| 71 | PTR24_ALIGN = 32 |
| 72 | PTR24_BASE = 0xe0000000 |
| 73 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 74 | # Included from sys/param.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 75 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 76 | _POSIX_VDISABLE = 0 |
| 77 | MAX_INPUT = 512 |
| 78 | MAX_CANON = 256 |
| 79 | UID_NOBODY = 60001 |
| 80 | GID_NOBODY = UID_NOBODY |
| 81 | UID_NOACCESS = 60002 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 82 | MAX_TASKID = 999999 |
| 83 | MAX_MAXPID = 999999 |
| 84 | DEFAULT_MAXPID = 999999 |
| 85 | DEFAULT_JUMPPID = 100000 |
| 86 | DEFAULT_MAXPID = 30000 |
| 87 | DEFAULT_JUMPPID = 0 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 88 | MAXUID = 2147483647 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 89 | MAXPROJID = MAXUID |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 90 | MAXLINK = 32767 |
| 91 | NMOUNT = 40 |
| 92 | CANBSIZ = 256 |
| 93 | NOFILE = 20 |
| 94 | NGROUPS_UMIN = 0 |
| 95 | NGROUPS_UMAX = 32 |
| 96 | NGROUPS_MAX_DEFAULT = 16 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 97 | NZERO = 20 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 98 | NULL = 0L |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 99 | NULL = 0 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 100 | CMASK = 022 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 101 | CDLIMIT = (1L<<11) |
| 102 | NBPS = 0x20000 |
| 103 | NBPSCTR = 512 |
| 104 | UBSIZE = 512 |
| 105 | SCTRSHFT = 9 |
| 106 | SYSNAME = 9 |
| 107 | PREMOTE = 39 |
| 108 | MAXPATHLEN = 1024 |
| 109 | MAXSYMLINKS = 20 |
| 110 | MAXNAMELEN = 256 |
| 111 | NADDR = 13 |
| 112 | PIPE_BUF = 5120 |
| 113 | PIPE_MAX = 5120 |
| 114 | NBBY = 8 |
| 115 | MAXBSIZE = 8192 |
| 116 | DEV_BSIZE = 512 |
| 117 | DEV_BSHIFT = 9 |
| 118 | MAXFRAG = 8 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 119 | MAXOFF32_T = 0x7fffffff |
| 120 | MAXOFF_T = 0x7fffffffffffffffl |
| 121 | MAXOFFSET_T = 0x7fffffffffffffffl |
| 122 | MAXOFF_T = 0x7fffffffl |
| 123 | MAXOFFSET_T = 0x7fffffff |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 124 | def btodb(bytes): return \ |
| 125 | |
| 126 | def dbtob(db): return \ |
| 127 | |
| 128 | def lbtodb(bytes): return \ |
| 129 | |
| 130 | def ldbtob(db): return \ |
| 131 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 132 | NCARGS32 = 0x100000 |
| 133 | NCARGS64 = 0x200000 |
| 134 | NCARGS = NCARGS64 |
| 135 | NCARGS = NCARGS32 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 136 | FSHIFT = 8 |
| 137 | FSCALE = (1<<FSHIFT) |
| 138 | def DELAY(n): return drv_usecwait(n) |
| 139 | |
| 140 | def mmu_ptob(x): return ((x) << MMU_PAGESHIFT) |
| 141 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 142 | def mmu_btop(x): return (((x)) >> MMU_PAGESHIFT) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 143 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 144 | def mmu_btopr(x): return ((((x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT)) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 145 | |
| 146 | def mmu_ptod(x): return ((x) << (MMU_PAGESHIFT - DEV_BSHIFT)) |
| 147 | |
| 148 | def ptod(x): return ((x) << (PAGESHIFT - DEV_BSHIFT)) |
| 149 | |
| 150 | def ptob(x): return ((x) << PAGESHIFT) |
| 151 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 152 | def btop(x): return (((x) >> PAGESHIFT)) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 153 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 154 | def btopr(x): return ((((x) + PAGEOFFSET) >> PAGESHIFT)) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 155 | |
| 156 | def dtop(DD): return (((DD) + NDPP - 1) >> (PAGESHIFT - DEV_BSHIFT)) |
| 157 | |
| 158 | def dtopt(DD): return ((DD) >> (PAGESHIFT - DEV_BSHIFT)) |
| 159 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 160 | _AIO_LISTIO_MAX = (4096) |
| 161 | _AIO_MAX = (-1) |
| 162 | _MQ_OPEN_MAX = (32) |
| 163 | _MQ_PRIO_MAX = (32) |
| 164 | _SEM_NSEMS_MAX = INT_MAX |
| 165 | _SEM_VALUE_MAX = INT_MAX |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 166 | |
| 167 | # Included from sys/unistd.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 168 | _CS_PATH = 65 |
| 169 | _CS_LFS_CFLAGS = 68 |
| 170 | _CS_LFS_LDFLAGS = 69 |
| 171 | _CS_LFS_LIBS = 70 |
| 172 | _CS_LFS_LINTFLAGS = 71 |
| 173 | _CS_LFS64_CFLAGS = 72 |
| 174 | _CS_LFS64_LDFLAGS = 73 |
| 175 | _CS_LFS64_LIBS = 74 |
| 176 | _CS_LFS64_LINTFLAGS = 75 |
| 177 | _CS_XBS5_ILP32_OFF32_CFLAGS = 700 |
| 178 | _CS_XBS5_ILP32_OFF32_LDFLAGS = 701 |
| 179 | _CS_XBS5_ILP32_OFF32_LIBS = 702 |
| 180 | _CS_XBS5_ILP32_OFF32_LINTFLAGS = 703 |
| 181 | _CS_XBS5_ILP32_OFFBIG_CFLAGS = 705 |
| 182 | _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 706 |
| 183 | _CS_XBS5_ILP32_OFFBIG_LIBS = 707 |
| 184 | _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 708 |
| 185 | _CS_XBS5_LP64_OFF64_CFLAGS = 709 |
| 186 | _CS_XBS5_LP64_OFF64_LDFLAGS = 710 |
| 187 | _CS_XBS5_LP64_OFF64_LIBS = 711 |
| 188 | _CS_XBS5_LP64_OFF64_LINTFLAGS = 712 |
| 189 | _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 713 |
| 190 | _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 714 |
| 191 | _CS_XBS5_LPBIG_OFFBIG_LIBS = 715 |
| 192 | _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 716 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 193 | _SC_ARG_MAX = 1 |
| 194 | _SC_CHILD_MAX = 2 |
| 195 | _SC_CLK_TCK = 3 |
| 196 | _SC_NGROUPS_MAX = 4 |
| 197 | _SC_OPEN_MAX = 5 |
| 198 | _SC_JOB_CONTROL = 6 |
| 199 | _SC_SAVED_IDS = 7 |
| 200 | _SC_VERSION = 8 |
| 201 | _SC_PASS_MAX = 9 |
| 202 | _SC_LOGNAME_MAX = 10 |
| 203 | _SC_PAGESIZE = 11 |
| 204 | _SC_XOPEN_VERSION = 12 |
| 205 | _SC_NPROCESSORS_CONF = 14 |
| 206 | _SC_NPROCESSORS_ONLN = 15 |
| 207 | _SC_STREAM_MAX = 16 |
| 208 | _SC_TZNAME_MAX = 17 |
| 209 | _SC_AIO_LISTIO_MAX = 18 |
| 210 | _SC_AIO_MAX = 19 |
| 211 | _SC_AIO_PRIO_DELTA_MAX = 20 |
| 212 | _SC_ASYNCHRONOUS_IO = 21 |
| 213 | _SC_DELAYTIMER_MAX = 22 |
| 214 | _SC_FSYNC = 23 |
| 215 | _SC_MAPPED_FILES = 24 |
| 216 | _SC_MEMLOCK = 25 |
| 217 | _SC_MEMLOCK_RANGE = 26 |
| 218 | _SC_MEMORY_PROTECTION = 27 |
| 219 | _SC_MESSAGE_PASSING = 28 |
| 220 | _SC_MQ_OPEN_MAX = 29 |
| 221 | _SC_MQ_PRIO_MAX = 30 |
| 222 | _SC_PRIORITIZED_IO = 31 |
| 223 | _SC_PRIORITY_SCHEDULING = 32 |
| 224 | _SC_REALTIME_SIGNALS = 33 |
| 225 | _SC_RTSIG_MAX = 34 |
| 226 | _SC_SEMAPHORES = 35 |
| 227 | _SC_SEM_NSEMS_MAX = 36 |
| 228 | _SC_SEM_VALUE_MAX = 37 |
| 229 | _SC_SHARED_MEMORY_OBJECTS = 38 |
| 230 | _SC_SIGQUEUE_MAX = 39 |
| 231 | _SC_SIGRT_MIN = 40 |
| 232 | _SC_SIGRT_MAX = 41 |
| 233 | _SC_SYNCHRONIZED_IO = 42 |
| 234 | _SC_TIMERS = 43 |
| 235 | _SC_TIMER_MAX = 44 |
| 236 | _SC_2_C_BIND = 45 |
| 237 | _SC_2_C_DEV = 46 |
| 238 | _SC_2_C_VERSION = 47 |
| 239 | _SC_2_FORT_DEV = 48 |
| 240 | _SC_2_FORT_RUN = 49 |
| 241 | _SC_2_LOCALEDEF = 50 |
| 242 | _SC_2_SW_DEV = 51 |
| 243 | _SC_2_UPE = 52 |
| 244 | _SC_2_VERSION = 53 |
| 245 | _SC_BC_BASE_MAX = 54 |
| 246 | _SC_BC_DIM_MAX = 55 |
| 247 | _SC_BC_SCALE_MAX = 56 |
| 248 | _SC_BC_STRING_MAX = 57 |
| 249 | _SC_COLL_WEIGHTS_MAX = 58 |
| 250 | _SC_EXPR_NEST_MAX = 59 |
| 251 | _SC_LINE_MAX = 60 |
| 252 | _SC_RE_DUP_MAX = 61 |
| 253 | _SC_XOPEN_CRYPT = 62 |
| 254 | _SC_XOPEN_ENH_I18N = 63 |
| 255 | _SC_XOPEN_SHM = 64 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 256 | _SC_2_CHAR_TERM = 66 |
| 257 | _SC_XOPEN_XCU_VERSION = 67 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 258 | _SC_ATEXIT_MAX = 76 |
| 259 | _SC_IOV_MAX = 77 |
| 260 | _SC_XOPEN_UNIX = 78 |
| 261 | _SC_PAGE_SIZE = _SC_PAGESIZE |
| 262 | _SC_T_IOV_MAX = 79 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 263 | _SC_PHYS_PAGES = 500 |
| 264 | _SC_AVPHYS_PAGES = 501 |
| 265 | _SC_COHER_BLKSZ = 503 |
| 266 | _SC_SPLIT_CACHE = 504 |
| 267 | _SC_ICACHE_SZ = 505 |
| 268 | _SC_DCACHE_SZ = 506 |
| 269 | _SC_ICACHE_LINESZ = 507 |
| 270 | _SC_DCACHE_LINESZ = 508 |
| 271 | _SC_ICACHE_BLKSZ = 509 |
| 272 | _SC_DCACHE_BLKSZ = 510 |
| 273 | _SC_DCACHE_TBLKSZ = 511 |
| 274 | _SC_ICACHE_ASSOC = 512 |
| 275 | _SC_DCACHE_ASSOC = 513 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 276 | _SC_MAXPID = 514 |
| 277 | _SC_STACK_PROT = 515 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 278 | _SC_THREAD_DESTRUCTOR_ITERATIONS = 568 |
| 279 | _SC_GETGR_R_SIZE_MAX = 569 |
| 280 | _SC_GETPW_R_SIZE_MAX = 570 |
| 281 | _SC_LOGIN_NAME_MAX = 571 |
| 282 | _SC_THREAD_KEYS_MAX = 572 |
| 283 | _SC_THREAD_STACK_MIN = 573 |
| 284 | _SC_THREAD_THREADS_MAX = 574 |
| 285 | _SC_TTY_NAME_MAX = 575 |
| 286 | _SC_THREADS = 576 |
| 287 | _SC_THREAD_ATTR_STACKADDR = 577 |
| 288 | _SC_THREAD_ATTR_STACKSIZE = 578 |
| 289 | _SC_THREAD_PRIORITY_SCHEDULING = 579 |
| 290 | _SC_THREAD_PRIO_INHERIT = 580 |
| 291 | _SC_THREAD_PRIO_PROTECT = 581 |
| 292 | _SC_THREAD_PROCESS_SHARED = 582 |
| 293 | _SC_THREAD_SAFE_FUNCTIONS = 583 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 294 | _SC_XOPEN_LEGACY = 717 |
| 295 | _SC_XOPEN_REALTIME = 718 |
| 296 | _SC_XOPEN_REALTIME_THREADS = 719 |
| 297 | _SC_XBS5_ILP32_OFF32 = 720 |
| 298 | _SC_XBS5_ILP32_OFFBIG = 721 |
| 299 | _SC_XBS5_LP64_OFF64 = 722 |
| 300 | _SC_XBS5_LPBIG_OFFBIG = 723 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 301 | _PC_LINK_MAX = 1 |
| 302 | _PC_MAX_CANON = 2 |
| 303 | _PC_MAX_INPUT = 3 |
| 304 | _PC_NAME_MAX = 4 |
| 305 | _PC_PATH_MAX = 5 |
| 306 | _PC_PIPE_BUF = 6 |
| 307 | _PC_NO_TRUNC = 7 |
| 308 | _PC_VDISABLE = 8 |
| 309 | _PC_CHOWN_RESTRICTED = 9 |
| 310 | _PC_ASYNC_IO = 10 |
| 311 | _PC_PRIO_IO = 11 |
| 312 | _PC_SYNC_IO = 12 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 313 | _PC_FILESIZEBITS = 67 |
| 314 | _PC_LAST = 67 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 315 | _POSIX_VERSION = 199506L |
| 316 | _POSIX2_VERSION = 199209L |
| 317 | _POSIX2_C_VERSION = 199209L |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 318 | _XOPEN_XCU_VERSION = 4 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 319 | _XOPEN_REALTIME = 1 |
| 320 | _XOPEN_ENH_I18N = 1 |
| 321 | _XOPEN_SHM = 1 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 322 | _POSIX2_C_BIND = 1 |
| 323 | _POSIX2_CHAR_TERM = 1 |
| 324 | _POSIX2_LOCALEDEF = 1 |
| 325 | _POSIX2_C_DEV = 1 |
| 326 | _POSIX2_SW_DEV = 1 |
| 327 | _POSIX2_UPE = 1 |
| 328 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 329 | # Included from sys/mutex.h |
| 330 | from TYPES import * |
| 331 | def MUTEX_HELD(x): return (mutex_owned(x)) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 332 | |
| 333 | |
| 334 | # Included from sys/rwlock.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 335 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 336 | def RW_READ_HELD(x): return (rw_read_held((x))) |
| 337 | |
| 338 | def RW_WRITE_HELD(x): return (rw_write_held((x))) |
| 339 | |
| 340 | def RW_LOCK_HELD(x): return (rw_lock_held((x))) |
| 341 | |
| 342 | def RW_ISWRITER(x): return (rw_iswriter(x)) |
| 343 | |
| 344 | |
| 345 | # Included from sys/semaphore.h |
| 346 | |
| 347 | # Included from sys/thread.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 348 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 349 | |
| 350 | # Included from sys/klwp.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 351 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 352 | |
| 353 | # Included from sys/condvar.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 354 | from TYPES import * |
| 355 | |
| 356 | # Included from sys/time.h |
| 357 | |
| 358 | # Included from sys/types32.h |
| 359 | |
| 360 | # Included from sys/int_types.h |
| 361 | TIME32_MAX = INT32_MAX |
| 362 | TIME32_MIN = INT32_MIN |
| 363 | def TIMEVAL_OVERFLOW(tv): return \ |
| 364 | |
| 365 | from TYPES import * |
| 366 | DST_NONE = 0 |
| 367 | DST_USA = 1 |
| 368 | DST_AUST = 2 |
| 369 | DST_WET = 3 |
| 370 | DST_MET = 4 |
| 371 | DST_EET = 5 |
| 372 | DST_CAN = 6 |
| 373 | DST_GB = 7 |
| 374 | DST_RUM = 8 |
| 375 | DST_TUR = 9 |
| 376 | DST_AUSTALT = 10 |
| 377 | ITIMER_REAL = 0 |
| 378 | ITIMER_VIRTUAL = 1 |
| 379 | ITIMER_PROF = 2 |
| 380 | ITIMER_REALPROF = 3 |
| 381 | def ITIMERVAL_OVERFLOW(itv): return \ |
| 382 | |
| 383 | SEC = 1 |
| 384 | MILLISEC = 1000 |
| 385 | MICROSEC = 1000000 |
| 386 | NANOSEC = 1000000000 |
| 387 | |
| 388 | # Included from sys/time_impl.h |
| 389 | def TIMESPEC_OVERFLOW(ts): return \ |
| 390 | |
| 391 | def ITIMERSPEC_OVERFLOW(it): return \ |
| 392 | |
| 393 | __CLOCK_REALTIME0 = 0 |
| 394 | CLOCK_VIRTUAL = 1 |
| 395 | CLOCK_PROF = 2 |
| 396 | __CLOCK_REALTIME3 = 3 |
| 397 | CLOCK_HIGHRES = 4 |
| 398 | CLOCK_MAX = 5 |
| 399 | CLOCK_REALTIME = __CLOCK_REALTIME3 |
| 400 | CLOCK_REALTIME = __CLOCK_REALTIME0 |
| 401 | TIMER_RELTIME = 0x0 |
| 402 | TIMER_ABSTIME = 0x1 |
| 403 | def TICK_TO_SEC(tick): return ((tick) / hz) |
| 404 | |
| 405 | def SEC_TO_TICK(sec): return ((sec) * hz) |
| 406 | |
| 407 | def TICK_TO_MSEC(tick): return \ |
| 408 | |
| 409 | def MSEC_TO_TICK(msec): return \ |
| 410 | |
| 411 | def MSEC_TO_TICK_ROUNDUP(msec): return \ |
| 412 | |
| 413 | def TICK_TO_USEC(tick): return ((tick) * usec_per_tick) |
| 414 | |
| 415 | def USEC_TO_TICK(usec): return ((usec) / usec_per_tick) |
| 416 | |
| 417 | def USEC_TO_TICK_ROUNDUP(usec): return \ |
| 418 | |
| 419 | def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick) |
| 420 | |
| 421 | def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick) |
| 422 | |
| 423 | def NSEC_TO_TICK_ROUNDUP(nsec): return \ |
| 424 | |
| 425 | def TIMEVAL_TO_TICK(tvp): return \ |
| 426 | |
| 427 | def TIMESTRUC_TO_TICK(tsp): return \ |
| 428 | |
| 429 | |
| 430 | # Included from time.h |
| 431 | from TYPES import * |
| 432 | |
| 433 | # Included from iso/time_iso.h |
| 434 | NULL = 0L |
| 435 | NULL = 0 |
| 436 | CLOCKS_PER_SEC = 1000000 |
| 437 | |
| 438 | # Included from sys/select.h |
| 439 | FD_SETSIZE = 65536 |
| 440 | FD_SETSIZE = 1024 |
| 441 | _NBBY = 8 |
| 442 | NBBY = _NBBY |
| 443 | def FD_ZERO(p): return bzero((p), sizeof (*(p))) |
| 444 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 445 | |
| 446 | # Included from sys/signal.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 447 | |
| 448 | # Included from sys/iso/signal_iso.h |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 449 | SIGHUP = 1 |
| 450 | SIGINT = 2 |
| 451 | SIGQUIT = 3 |
| 452 | SIGILL = 4 |
| 453 | SIGTRAP = 5 |
| 454 | SIGIOT = 6 |
| 455 | SIGABRT = 6 |
| 456 | SIGEMT = 7 |
| 457 | SIGFPE = 8 |
| 458 | SIGKILL = 9 |
| 459 | SIGBUS = 10 |
| 460 | SIGSEGV = 11 |
| 461 | SIGSYS = 12 |
| 462 | SIGPIPE = 13 |
| 463 | SIGALRM = 14 |
| 464 | SIGTERM = 15 |
| 465 | SIGUSR1 = 16 |
| 466 | SIGUSR2 = 17 |
| 467 | SIGCLD = 18 |
| 468 | SIGCHLD = 18 |
| 469 | SIGPWR = 19 |
| 470 | SIGWINCH = 20 |
| 471 | SIGURG = 21 |
| 472 | SIGPOLL = 22 |
| 473 | SIGIO = SIGPOLL |
| 474 | SIGSTOP = 23 |
| 475 | SIGTSTP = 24 |
| 476 | SIGCONT = 25 |
| 477 | SIGTTIN = 26 |
| 478 | SIGTTOU = 27 |
| 479 | SIGVTALRM = 28 |
| 480 | SIGPROF = 29 |
| 481 | SIGXCPU = 30 |
| 482 | SIGXFSZ = 31 |
| 483 | SIGWAITING = 32 |
| 484 | SIGLWP = 33 |
| 485 | SIGFREEZE = 34 |
| 486 | SIGTHAW = 35 |
| 487 | SIGCANCEL = 36 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 488 | SIGLOST = 37 |
| 489 | _SIGRTMIN = 38 |
| 490 | _SIGRTMAX = 45 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 491 | SIG_BLOCK = 1 |
| 492 | SIG_UNBLOCK = 2 |
| 493 | SIG_SETMASK = 3 |
| 494 | SIGNO_MASK = 0xFF |
| 495 | SIGDEFER = 0x100 |
| 496 | SIGHOLD = 0x200 |
| 497 | SIGRELSE = 0x400 |
| 498 | SIGIGNORE = 0x800 |
| 499 | SIGPAUSE = 0x1000 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 500 | |
| 501 | # Included from sys/siginfo.h |
| 502 | from TYPES import * |
| 503 | SIGEV_NONE = 1 |
| 504 | SIGEV_SIGNAL = 2 |
| 505 | SIGEV_THREAD = 3 |
| 506 | SI_NOINFO = 32767 |
| 507 | SI_USER = 0 |
| 508 | SI_LWP = (-1) |
| 509 | SI_QUEUE = (-2) |
| 510 | SI_TIMER = (-3) |
| 511 | SI_ASYNCIO = (-4) |
| 512 | SI_MESGQ = (-5) |
| 513 | |
| 514 | # Included from sys/machsig.h |
| 515 | ILL_ILLOPC = 1 |
| 516 | ILL_ILLOPN = 2 |
| 517 | ILL_ILLADR = 3 |
| 518 | ILL_ILLTRP = 4 |
| 519 | ILL_PRVOPC = 5 |
| 520 | ILL_PRVREG = 6 |
| 521 | ILL_COPROC = 7 |
| 522 | ILL_BADSTK = 8 |
| 523 | NSIGILL = 8 |
| 524 | EMT_TAGOVF = 1 |
| 525 | EMT_CPCOVF = 2 |
| 526 | NSIGEMT = 2 |
| 527 | FPE_INTDIV = 1 |
| 528 | FPE_INTOVF = 2 |
| 529 | FPE_FLTDIV = 3 |
| 530 | FPE_FLTOVF = 4 |
| 531 | FPE_FLTUND = 5 |
| 532 | FPE_FLTRES = 6 |
| 533 | FPE_FLTINV = 7 |
| 534 | FPE_FLTSUB = 8 |
| 535 | NSIGFPE = 8 |
| 536 | SEGV_MAPERR = 1 |
| 537 | SEGV_ACCERR = 2 |
| 538 | NSIGSEGV = 2 |
| 539 | BUS_ADRALN = 1 |
| 540 | BUS_ADRERR = 2 |
| 541 | BUS_OBJERR = 3 |
| 542 | NSIGBUS = 3 |
| 543 | TRAP_BRKPT = 1 |
| 544 | TRAP_TRACE = 2 |
| 545 | TRAP_RWATCH = 3 |
| 546 | TRAP_WWATCH = 4 |
| 547 | TRAP_XWATCH = 5 |
| 548 | NSIGTRAP = 5 |
| 549 | CLD_EXITED = 1 |
| 550 | CLD_KILLED = 2 |
| 551 | CLD_DUMPED = 3 |
| 552 | CLD_TRAPPED = 4 |
| 553 | CLD_STOPPED = 5 |
| 554 | CLD_CONTINUED = 6 |
| 555 | NSIGCLD = 6 |
| 556 | POLL_IN = 1 |
| 557 | POLL_OUT = 2 |
| 558 | POLL_MSG = 3 |
| 559 | POLL_ERR = 4 |
| 560 | POLL_PRI = 5 |
| 561 | POLL_HUP = 6 |
| 562 | NSIGPOLL = 6 |
| 563 | PROF_SIG = 1 |
| 564 | NSIGPROF = 1 |
| 565 | SI_MAXSZ = 256 |
| 566 | SI_MAXSZ = 128 |
| 567 | |
| 568 | # Included from sys/time_std_impl.h |
| 569 | from TYPES import * |
| 570 | SI32_MAXSZ = 128 |
| 571 | def SI_CANQUEUE(c): return ((c) <= SI_QUEUE) |
| 572 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 573 | SA_NOCLDSTOP = 0x00020000 |
| 574 | SA_ONSTACK = 0x00000001 |
| 575 | SA_RESETHAND = 0x00000002 |
| 576 | SA_RESTART = 0x00000004 |
| 577 | SA_SIGINFO = 0x00000008 |
| 578 | SA_NODEFER = 0x00000010 |
| 579 | SA_NOCLDWAIT = 0x00010000 |
| 580 | SA_WAITSIG = 0x00010000 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 581 | NSIG = 46 |
| 582 | MAXSIG = 45 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 583 | S_SIGNAL = 1 |
| 584 | S_SIGSET = 2 |
| 585 | S_SIGACTION = 3 |
| 586 | S_NONE = 4 |
| 587 | MINSIGSTKSZ = 2048 |
| 588 | SIGSTKSZ = 8192 |
| 589 | SS_ONSTACK = 0x00000001 |
| 590 | SS_DISABLE = 0x00000002 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 591 | SN_PROC = 1 |
| 592 | SN_CANCEL = 2 |
| 593 | SN_SEND = 3 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 594 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 595 | # Included from sys/ucontext.h |
| 596 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 597 | |
| 598 | # Included from sys/regset.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 599 | REG_CCR = (0) |
| 600 | REG_PSR = (0) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 601 | REG_PSR = (0) |
| 602 | REG_PC = (1) |
| 603 | REG_nPC = (2) |
| 604 | REG_Y = (3) |
| 605 | REG_G1 = (4) |
| 606 | REG_G2 = (5) |
| 607 | REG_G3 = (6) |
| 608 | REG_G4 = (7) |
| 609 | REG_G5 = (8) |
| 610 | REG_G6 = (9) |
| 611 | REG_G7 = (10) |
| 612 | REG_O0 = (11) |
| 613 | REG_O1 = (12) |
| 614 | REG_O2 = (13) |
| 615 | REG_O3 = (14) |
| 616 | REG_O4 = (15) |
| 617 | REG_O5 = (16) |
| 618 | REG_O6 = (17) |
| 619 | REG_O7 = (18) |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 620 | REG_ASI = (19) |
| 621 | REG_FPRS = (20) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 622 | REG_PS = REG_PSR |
| 623 | REG_SP = REG_O6 |
| 624 | REG_R0 = REG_O0 |
| 625 | REG_R1 = REG_O1 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 626 | _NGREG = 21 |
| 627 | _NGREG = 19 |
| 628 | NGREG = _NGREG |
| 629 | _NGREG32 = 19 |
| 630 | _NGREG64 = 21 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 631 | SPARC_MAXREGWINDOW = 31 |
| 632 | MAXFPQ = 16 |
| 633 | XRS_ID = 0x78727300 |
| 634 | |
| 635 | # Included from v7/sys/privregs.h |
| 636 | |
| 637 | # Included from v7/sys/psr.h |
| 638 | PSR_CWP = 0x0000001F |
| 639 | PSR_ET = 0x00000020 |
| 640 | PSR_PS = 0x00000040 |
| 641 | PSR_S = 0x00000080 |
| 642 | PSR_PIL = 0x00000F00 |
| 643 | PSR_EF = 0x00001000 |
| 644 | PSR_EC = 0x00002000 |
| 645 | PSR_RSV = 0x000FC000 |
| 646 | PSR_ICC = 0x00F00000 |
| 647 | PSR_C = 0x00100000 |
| 648 | PSR_V = 0x00200000 |
| 649 | PSR_Z = 0x00400000 |
| 650 | PSR_N = 0x00800000 |
| 651 | PSR_VER = 0x0F000000 |
| 652 | PSR_IMPL = 0xF0000000 |
| 653 | PSL_ALLCC = PSR_ICC |
| 654 | PSL_USER = (PSR_S) |
| 655 | PSL_USERMASK = (PSR_ICC) |
| 656 | PSL_UBITS = (PSR_ICC|PSR_EF) |
| 657 | def USERMODE(ps): return (((ps) & PSR_PS) == 0) |
| 658 | |
| 659 | |
| 660 | # Included from sys/fsr.h |
| 661 | FSR_CEXC = 0x0000001f |
| 662 | FSR_AEXC = 0x000003e0 |
| 663 | FSR_FCC = 0x00000c00 |
| 664 | FSR_PR = 0x00001000 |
| 665 | FSR_QNE = 0x00002000 |
| 666 | FSR_FTT = 0x0001c000 |
| 667 | FSR_VER = 0x000e0000 |
| 668 | FSR_TEM = 0x0f800000 |
| 669 | FSR_RP = 0x30000000 |
| 670 | FSR_RD = 0xc0000000 |
| 671 | FSR_VER_SHIFT = 17 |
| 672 | FSR_FCC1 = 0x00000003 |
| 673 | FSR_FCC2 = 0x0000000C |
| 674 | FSR_FCC3 = 0x00000030 |
| 675 | FSR_CEXC_NX = 0x00000001 |
| 676 | FSR_CEXC_DZ = 0x00000002 |
| 677 | FSR_CEXC_UF = 0x00000004 |
| 678 | FSR_CEXC_OF = 0x00000008 |
| 679 | FSR_CEXC_NV = 0x00000010 |
| 680 | FSR_AEXC_NX = (0x1 << 5) |
| 681 | FSR_AEXC_DZ = (0x2 << 5) |
| 682 | FSR_AEXC_UF = (0x4 << 5) |
| 683 | FSR_AEXC_OF = (0x8 << 5) |
| 684 | FSR_AEXC_NV = (0x10 << 5) |
| 685 | FTT_NONE = 0 |
| 686 | FTT_IEEE = 1 |
| 687 | FTT_UNFIN = 2 |
| 688 | FTT_UNIMP = 3 |
| 689 | FTT_SEQ = 4 |
| 690 | FTT_ALIGN = 5 |
| 691 | FTT_DFAULT = 6 |
| 692 | FSR_FTT_SHIFT = 14 |
| 693 | FSR_FTT_IEEE = (FTT_IEEE << FSR_FTT_SHIFT) |
| 694 | FSR_FTT_UNFIN = (FTT_UNFIN << FSR_FTT_SHIFT) |
| 695 | FSR_FTT_UNIMP = (FTT_UNIMP << FSR_FTT_SHIFT) |
| 696 | FSR_FTT_SEQ = (FTT_SEQ << FSR_FTT_SHIFT) |
| 697 | FSR_FTT_ALIGN = (FTT_ALIGN << FSR_FTT_SHIFT) |
| 698 | FSR_FTT_DFAULT = (FTT_DFAULT << FSR_FTT_SHIFT) |
| 699 | FSR_TEM_NX = (0x1 << 23) |
| 700 | FSR_TEM_DZ = (0x2 << 23) |
| 701 | FSR_TEM_UF = (0x4 << 23) |
| 702 | FSR_TEM_OF = (0x8 << 23) |
| 703 | FSR_TEM_NV = (0x10 << 23) |
| 704 | RP_DBLEXT = 0 |
| 705 | RP_SINGLE = 1 |
| 706 | RP_DOUBLE = 2 |
| 707 | RP_RESERVED = 3 |
| 708 | RD_NEAR = 0 |
| 709 | RD_ZER0 = 1 |
| 710 | RD_POSINF = 2 |
| 711 | RD_NEGINF = 3 |
| 712 | FPRS_DL = 0x1 |
| 713 | FPRS_DU = 0x2 |
| 714 | FPRS_FEF = 0x4 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 715 | PIL_MAX = 0xf |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 716 | def SAVE_GLOBALS(RP): return \ |
| 717 | |
| 718 | def RESTORE_GLOBALS(RP): return \ |
| 719 | |
| 720 | def SAVE_OUTS(RP): return \ |
| 721 | |
| 722 | def RESTORE_OUTS(RP): return \ |
| 723 | |
| 724 | def SAVE_WINDOW(SBP): return \ |
| 725 | |
| 726 | def RESTORE_WINDOW(SBP): return \ |
| 727 | |
| 728 | def STORE_FPREGS(FP): return \ |
| 729 | |
| 730 | def LOAD_FPREGS(FP): return \ |
| 731 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 732 | _SPARC_MAXREGWINDOW = 31 |
| 733 | _XRS_ID = 0x78727300 |
| 734 | GETCONTEXT = 0 |
| 735 | SETCONTEXT = 1 |
| 736 | UC_SIGMASK = 001 |
| 737 | UC_STACK = 002 |
| 738 | UC_CPU = 004 |
| 739 | UC_MAU = 010 |
| 740 | UC_FPU = UC_MAU |
| 741 | UC_INTR = 020 |
| 742 | UC_ASR = 040 |
| 743 | UC_MCONTEXT = (UC_CPU|UC_FPU|UC_ASR) |
| 744 | UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT) |
| 745 | _SIGQUEUE_MAX = 32 |
| 746 | _SIGNOTIFY_MAX = 32 |
| 747 | |
| 748 | # Included from sys/pcb.h |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 749 | INSTR_VALID = 0x02 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 750 | NORMAL_STEP = 0x04 |
| 751 | WATCH_STEP = 0x08 |
| 752 | CPC_OVERFLOW = 0x10 |
| 753 | ASYNC_HWERR = 0x20 |
| 754 | STEP_NONE = 0 |
| 755 | STEP_REQUESTED = 1 |
| 756 | STEP_ACTIVE = 2 |
| 757 | STEP_WASACTIVE = 3 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 758 | |
| 759 | # Included from sys/msacct.h |
| 760 | LMS_USER = 0 |
| 761 | LMS_SYSTEM = 1 |
| 762 | LMS_TRAP = 2 |
| 763 | LMS_TFAULT = 3 |
| 764 | LMS_DFAULT = 4 |
| 765 | LMS_KFAULT = 5 |
| 766 | LMS_USER_LOCK = 6 |
| 767 | LMS_SLEEP = 7 |
| 768 | LMS_WAIT_CPU = 8 |
| 769 | LMS_STOPPED = 9 |
| 770 | NMSTATES = 10 |
| 771 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 772 | # Included from sys/lwp.h |
| 773 | |
| 774 | # Included from sys/synch.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 775 | from TYPES import * |
| 776 | USYNC_THREAD = 0x00 |
| 777 | USYNC_PROCESS = 0x01 |
| 778 | LOCK_NORMAL = 0x00 |
| 779 | LOCK_ERRORCHECK = 0x02 |
| 780 | LOCK_RECURSIVE = 0x04 |
| 781 | USYNC_PROCESS_ROBUST = 0x08 |
| 782 | LOCK_PRIO_NONE = 0x00 |
| 783 | LOCK_PRIO_INHERIT = 0x10 |
| 784 | LOCK_PRIO_PROTECT = 0x20 |
| 785 | LOCK_STALL_NP = 0x00 |
| 786 | LOCK_ROBUST_NP = 0x40 |
| 787 | LOCK_OWNERDEAD = 0x1 |
| 788 | LOCK_NOTRECOVERABLE = 0x2 |
| 789 | LOCK_INITED = 0x4 |
| 790 | LOCK_UNMAPPED = 0x8 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 791 | LWP_DETACHED = 0x00000040 |
| 792 | LWP_SUSPENDED = 0x00000080 |
| 793 | __LWP_ASLWP = 0x00000100 |
| 794 | MAXSYSARGS = 8 |
| 795 | NORMALRETURN = 0 |
| 796 | JUSTRETURN = 1 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 797 | LWP_USER = 0x01 |
| 798 | LWP_SYS = 0x02 |
| 799 | TS_FREE = 0x00 |
| 800 | TS_SLEEP = 0x01 |
| 801 | TS_RUN = 0x02 |
| 802 | TS_ONPROC = 0x04 |
| 803 | TS_ZOMB = 0x08 |
| 804 | TS_STOPPED = 0x10 |
| 805 | T_INTR_THREAD = 0x0001 |
| 806 | T_WAKEABLE = 0x0002 |
| 807 | T_TOMASK = 0x0004 |
| 808 | T_TALLOCSTK = 0x0008 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 809 | T_WOULDBLOCK = 0x0020 |
| 810 | T_DONTBLOCK = 0x0040 |
| 811 | T_DONTPEND = 0x0080 |
| 812 | T_SYS_PROF = 0x0100 |
| 813 | T_WAITCVSEM = 0x0200 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 814 | T_WATCHPT = 0x0400 |
| 815 | T_PANIC = 0x0800 |
| 816 | TP_HOLDLWP = 0x0002 |
| 817 | TP_TWAIT = 0x0004 |
| 818 | TP_LWPEXIT = 0x0008 |
| 819 | TP_PRSTOP = 0x0010 |
| 820 | TP_CHKPT = 0x0020 |
| 821 | TP_EXITLWP = 0x0040 |
| 822 | TP_PRVSTOP = 0x0080 |
| 823 | TP_MSACCT = 0x0100 |
| 824 | TP_STOPPING = 0x0200 |
| 825 | TP_WATCHPT = 0x0400 |
| 826 | TP_PAUSE = 0x0800 |
| 827 | TP_CHANGEBIND = 0x1000 |
| 828 | TS_LOAD = 0x0001 |
| 829 | TS_DONT_SWAP = 0x0002 |
| 830 | TS_SWAPENQ = 0x0004 |
| 831 | TS_ON_SWAPQ = 0x0008 |
| 832 | TS_CSTART = 0x0100 |
| 833 | TS_UNPAUSE = 0x0200 |
| 834 | TS_XSTART = 0x0400 |
| 835 | TS_PSTART = 0x0800 |
| 836 | TS_RESUME = 0x1000 |
| 837 | TS_CREATE = 0x2000 |
| 838 | TS_ALLSTART = \ |
Tim Peters | 182b5ac | 2004-07-18 06:16:08 +0000 | [diff] [blame] | 839 | (TS_CSTART|TS_UNPAUSE|TS_XSTART|TS_PSTART|TS_RESUME|TS_CREATE) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 840 | def CPR_VSTOPPED(t): return \ |
| 841 | |
| 842 | def THREAD_TRANSITION(tp): return thread_transition(tp); |
| 843 | |
| 844 | def THREAD_STOP(tp): return \ |
| 845 | |
| 846 | def THREAD_ZOMB(tp): return THREAD_SET_STATE(tp, TS_ZOMB, NULL) |
| 847 | |
| 848 | def SEMA_HELD(x): return (sema_held((x))) |
| 849 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 850 | NO_LOCKS_HELD = 1 |
| 851 | NO_COMPETING_THREADS = 1 |
| 852 | |
| 853 | # Included from sys/cred.h |
| 854 | |
| 855 | # Included from sys/uio.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 856 | from TYPES import * |
| 857 | |
| 858 | # Included from sys/resource.h |
| 859 | from TYPES import * |
| 860 | PRIO_PROCESS = 0 |
| 861 | PRIO_PGRP = 1 |
| 862 | PRIO_USER = 2 |
| 863 | RLIMIT_CPU = 0 |
| 864 | RLIMIT_FSIZE = 1 |
| 865 | RLIMIT_DATA = 2 |
| 866 | RLIMIT_STACK = 3 |
| 867 | RLIMIT_CORE = 4 |
| 868 | RLIMIT_NOFILE = 5 |
| 869 | RLIMIT_VMEM = 6 |
| 870 | RLIMIT_AS = RLIMIT_VMEM |
| 871 | RLIM_NLIMITS = 7 |
| 872 | RLIM_INFINITY = (-3l) |
| 873 | RLIM_SAVED_MAX = (-2l) |
| 874 | RLIM_SAVED_CUR = (-1l) |
| 875 | RLIM_INFINITY = 0x7fffffff |
| 876 | RLIM_SAVED_MAX = 0x7ffffffe |
| 877 | RLIM_SAVED_CUR = 0x7ffffffd |
| 878 | RLIM32_INFINITY = 0x7fffffff |
| 879 | RLIM32_SAVED_MAX = 0x7ffffffe |
| 880 | RLIM32_SAVED_CUR = 0x7ffffffd |
| 881 | |
| 882 | # Included from sys/model.h |
| 883 | |
| 884 | # Included from sys/debug.h |
| 885 | def ASSERT64(x): return ASSERT(x) |
| 886 | |
| 887 | def ASSERT32(x): return ASSERT(x) |
| 888 | |
| 889 | DATAMODEL_MASK = 0x0FF00000 |
| 890 | DATAMODEL_ILP32 = 0x00100000 |
| 891 | DATAMODEL_LP64 = 0x00200000 |
| 892 | DATAMODEL_NONE = 0 |
| 893 | DATAMODEL_NATIVE = DATAMODEL_LP64 |
| 894 | DATAMODEL_NATIVE = DATAMODEL_ILP32 |
| 895 | def STRUCT_SIZE(handle): return \ |
| 896 | |
| 897 | def STRUCT_BUF(handle): return ((handle).ptr.m64) |
| 898 | |
| 899 | def SIZEOF_PTR(umodel): return \ |
| 900 | |
| 901 | def STRUCT_SIZE(handle): return (sizeof (*(handle).ptr)) |
| 902 | |
| 903 | def STRUCT_BUF(handle): return ((handle).ptr) |
| 904 | |
| 905 | def SIZEOF_PTR(umodel): return sizeof (caddr_t) |
| 906 | |
| 907 | def lwp_getdatamodel(t): return DATAMODEL_ILP32 |
| 908 | |
| 909 | RUSAGE_SELF = 0 |
| 910 | RUSAGE_CHILDREN = -1 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 911 | |
| 912 | # Included from vm/seg_enum.h |
| 913 | |
| 914 | # Included from sys/buf.h |
| 915 | |
| 916 | # Included from sys/kstat.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 917 | from TYPES import * |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 918 | KSTAT_STRLEN = 31 |
| 919 | def KSTAT_ENTER(k): return \ |
| 920 | |
| 921 | def KSTAT_EXIT(k): return \ |
| 922 | |
| 923 | KSTAT_TYPE_RAW = 0 |
| 924 | KSTAT_TYPE_NAMED = 1 |
| 925 | KSTAT_TYPE_INTR = 2 |
| 926 | KSTAT_TYPE_IO = 3 |
| 927 | KSTAT_TYPE_TIMER = 4 |
| 928 | KSTAT_NUM_TYPES = 5 |
| 929 | KSTAT_FLAG_VIRTUAL = 0x01 |
| 930 | KSTAT_FLAG_VAR_SIZE = 0x02 |
| 931 | KSTAT_FLAG_WRITABLE = 0x04 |
| 932 | KSTAT_FLAG_PERSISTENT = 0x08 |
| 933 | KSTAT_FLAG_DORMANT = 0x10 |
| 934 | KSTAT_FLAG_INVALID = 0x20 |
| 935 | KSTAT_READ = 0 |
| 936 | KSTAT_WRITE = 1 |
| 937 | KSTAT_DATA_CHAR = 0 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 938 | KSTAT_DATA_INT32 = 1 |
| 939 | KSTAT_DATA_UINT32 = 2 |
| 940 | KSTAT_DATA_INT64 = 3 |
| 941 | KSTAT_DATA_UINT64 = 4 |
| 942 | KSTAT_DATA_LONG = KSTAT_DATA_INT32 |
| 943 | KSTAT_DATA_ULONG = KSTAT_DATA_UINT32 |
| 944 | KSTAT_DATA_LONG = KSTAT_DATA_INT64 |
| 945 | KSTAT_DATA_ULONG = KSTAT_DATA_UINT64 |
| 946 | KSTAT_DATA_LONG = 7 |
| 947 | KSTAT_DATA_ULONG = 8 |
| 948 | KSTAT_DATA_LONGLONG = KSTAT_DATA_INT64 |
| 949 | KSTAT_DATA_ULONGLONG = KSTAT_DATA_UINT64 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 950 | KSTAT_DATA_FLOAT = 5 |
| 951 | KSTAT_DATA_DOUBLE = 6 |
| 952 | KSTAT_INTR_HARD = 0 |
| 953 | KSTAT_INTR_SOFT = 1 |
| 954 | KSTAT_INTR_WATCHDOG = 2 |
| 955 | KSTAT_INTR_SPURIOUS = 3 |
| 956 | KSTAT_INTR_MULTSVC = 4 |
| 957 | KSTAT_NUM_INTRS = 5 |
| 958 | B_BUSY = 0x0001 |
| 959 | B_DONE = 0x0002 |
| 960 | B_ERROR = 0x0004 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 961 | B_PAGEIO = 0x0010 |
| 962 | B_PHYS = 0x0020 |
| 963 | B_READ = 0x0040 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 964 | B_WRITE = 0x0100 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 965 | B_KERNBUF = 0x0008 |
| 966 | B_WANTED = 0x0080 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 967 | B_AGE = 0x000200 |
| 968 | B_ASYNC = 0x000400 |
| 969 | B_DELWRI = 0x000800 |
| 970 | B_STALE = 0x001000 |
| 971 | B_DONTNEED = 0x002000 |
| 972 | B_REMAPPED = 0x004000 |
| 973 | B_FREE = 0x008000 |
| 974 | B_INVAL = 0x010000 |
| 975 | B_FORCE = 0x020000 |
| 976 | B_HEAD = 0x040000 |
| 977 | B_NOCACHE = 0x080000 |
| 978 | B_TRUNC = 0x100000 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 979 | B_SHADOW = 0x200000 |
| 980 | B_RETRYWRI = 0x400000 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 981 | def notavail(bp): return \ |
| 982 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 983 | def BWRITE(bp): return \ |
| 984 | |
| 985 | def BWRITE2(bp): return \ |
| 986 | |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 987 | VROOT = 0x01 |
| 988 | VNOCACHE = 0x02 |
| 989 | VNOMAP = 0x04 |
| 990 | VDUP = 0x08 |
| 991 | VNOSWAP = 0x10 |
| 992 | VNOMOUNT = 0x20 |
| 993 | VISSWAP = 0x40 |
| 994 | VSWAPLIKE = 0x80 |
| 995 | VVFSLOCK = 0x100 |
| 996 | VVFSWAIT = 0x200 |
| 997 | VVMLOCK = 0x400 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 998 | VDIROPEN = 0x800 |
| 999 | VVMEXEC = 0x1000 |
| 1000 | VPXFS = 0x2000 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1001 | AT_TYPE = 0x0001 |
| 1002 | AT_MODE = 0x0002 |
| 1003 | AT_UID = 0x0004 |
| 1004 | AT_GID = 0x0008 |
| 1005 | AT_FSID = 0x0010 |
| 1006 | AT_NODEID = 0x0020 |
| 1007 | AT_NLINK = 0x0040 |
| 1008 | AT_SIZE = 0x0080 |
| 1009 | AT_ATIME = 0x0100 |
| 1010 | AT_MTIME = 0x0200 |
| 1011 | AT_CTIME = 0x0400 |
| 1012 | AT_RDEV = 0x0800 |
| 1013 | AT_BLKSIZE = 0x1000 |
| 1014 | AT_NBLOCKS = 0x2000 |
| 1015 | AT_VCODE = 0x4000 |
| 1016 | AT_ALL = (AT_TYPE|AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|\ |
Tim Peters | 182b5ac | 2004-07-18 06:16:08 +0000 | [diff] [blame] | 1017 | AT_NLINK|AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|\ |
| 1018 | AT_RDEV|AT_BLKSIZE|AT_NBLOCKS|AT_VCODE) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1019 | AT_STAT = (AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|AT_NLINK|\ |
Tim Peters | 182b5ac | 2004-07-18 06:16:08 +0000 | [diff] [blame] | 1020 | AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|AT_RDEV) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1021 | AT_TIMES = (AT_ATIME|AT_MTIME|AT_CTIME) |
| 1022 | AT_NOSET = (AT_NLINK|AT_RDEV|AT_FSID|AT_NODEID|AT_TYPE|\ |
Tim Peters | 182b5ac | 2004-07-18 06:16:08 +0000 | [diff] [blame] | 1023 | AT_BLKSIZE|AT_NBLOCKS|AT_VCODE) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1024 | VSUID = 04000 |
| 1025 | VSGID = 02000 |
| 1026 | VSVTX = 01000 |
| 1027 | VREAD = 00400 |
| 1028 | VWRITE = 00200 |
| 1029 | VEXEC = 00100 |
| 1030 | MODEMASK = 07777 |
| 1031 | PERMMASK = 00777 |
| 1032 | def MANDMODE(mode): return (((mode) & (VSGID|(VEXEC>>3))) == VSGID) |
| 1033 | |
| 1034 | VSA_ACL = 0x0001 |
| 1035 | VSA_ACLCNT = 0x0002 |
| 1036 | VSA_DFACL = 0x0004 |
| 1037 | VSA_DFACLCNT = 0x0008 |
| 1038 | LOOKUP_DIR = 0x01 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1039 | DUMP_ALLOC = 0 |
| 1040 | DUMP_FREE = 1 |
| 1041 | DUMP_SCAN = 2 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1042 | ATTR_UTIME = 0x01 |
| 1043 | ATTR_EXEC = 0x02 |
| 1044 | ATTR_COMM = 0x04 |
| 1045 | ATTR_HINT = 0x08 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1046 | ATTR_REAL = 0x10 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1047 | |
| 1048 | # Included from sys/poll.h |
| 1049 | POLLIN = 0x0001 |
| 1050 | POLLPRI = 0x0002 |
| 1051 | POLLOUT = 0x0004 |
| 1052 | POLLRDNORM = 0x0040 |
| 1053 | POLLWRNORM = POLLOUT |
| 1054 | POLLRDBAND = 0x0080 |
| 1055 | POLLWRBAND = 0x0100 |
| 1056 | POLLNORM = POLLRDNORM |
| 1057 | POLLERR = 0x0008 |
| 1058 | POLLHUP = 0x0010 |
| 1059 | POLLNVAL = 0x0020 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1060 | POLLREMOVE = 0x0800 |
| 1061 | POLLRDDATA = 0x0200 |
| 1062 | POLLNOERR = 0x0400 |
| 1063 | POLLCLOSED = 0x8000 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1064 | |
| 1065 | # Included from sys/strmdep.h |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1066 | def str_aligned(X): return (((ulong_t)(X) & (sizeof (long) - 1)) == 0) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1067 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1068 | |
| 1069 | # Included from sys/strft.h |
| 1070 | tdelta_t_sz = 12 |
| 1071 | FTEV_MASK = 0x1FFF |
| 1072 | FTEV_ISWR = 0x8000 |
| 1073 | FTEV_CS = 0x4000 |
| 1074 | FTEV_PS = 0x2000 |
| 1075 | FTEV_QMASK = 0x1F00 |
| 1076 | FTEV_ALLOCMASK = 0x1FF8 |
| 1077 | FTEV_ALLOCB = 0x0000 |
| 1078 | FTEV_ESBALLOC = 0x0001 |
| 1079 | FTEV_DESBALLOC = 0x0002 |
| 1080 | FTEV_ESBALLOCA = 0x0003 |
| 1081 | FTEV_DESBALLOCA = 0x0004 |
| 1082 | FTEV_ALLOCBIG = 0x0005 |
| 1083 | FTEV_ALLOCBW = 0x0006 |
| 1084 | FTEV_FREEB = 0x0008 |
| 1085 | FTEV_DUPB = 0x0009 |
| 1086 | FTEV_COPYB = 0x000A |
| 1087 | FTEV_CALLER = 0x000F |
| 1088 | FTEV_PUT = 0x0100 |
| 1089 | FTEV_FSYNCQ = 0x0103 |
| 1090 | FTEV_DSYNCQ = 0x0104 |
| 1091 | FTEV_PUTQ = 0x0105 |
| 1092 | FTEV_GETQ = 0x0106 |
| 1093 | FTEV_RMVQ = 0x0107 |
| 1094 | FTEV_INSQ = 0x0108 |
| 1095 | FTEV_PUTBQ = 0x0109 |
| 1096 | FTEV_FLUSHQ = 0x010A |
| 1097 | FTEV_REPLYQ = 0x010B |
| 1098 | FTEV_PUTNEXT = 0x010D |
| 1099 | FTEV_RWNEXT = 0x010E |
| 1100 | FTEV_QWINNER = 0x010F |
| 1101 | FTEV_GEWRITE = 0x0101 |
| 1102 | def FTFLW_HASH(h): return (((unsigned)(h))%ftflw_hash_sz) |
| 1103 | |
| 1104 | FTBLK_EVNTS = 0x9 |
| 1105 | QENAB = 0x00000001 |
| 1106 | QWANTR = 0x00000002 |
| 1107 | QWANTW = 0x00000004 |
| 1108 | QFULL = 0x00000008 |
| 1109 | QREADR = 0x00000010 |
| 1110 | QUSE = 0x00000020 |
| 1111 | QNOENB = 0x00000040 |
| 1112 | QBACK = 0x00000100 |
| 1113 | QHLIST = 0x00000200 |
| 1114 | QPAIR = 0x00000800 |
| 1115 | QPERQ = 0x00001000 |
| 1116 | QPERMOD = 0x00002000 |
| 1117 | QMTSAFE = 0x00004000 |
| 1118 | QMTOUTPERIM = 0x00008000 |
| 1119 | QMT_TYPEMASK = (QPAIR|QPERQ|QPERMOD|QMTSAFE|QMTOUTPERIM) |
| 1120 | QINSERVICE = 0x00010000 |
| 1121 | QWCLOSE = 0x00020000 |
| 1122 | QEND = 0x00040000 |
| 1123 | QWANTWSYNC = 0x00080000 |
| 1124 | QSYNCSTR = 0x00100000 |
| 1125 | QISDRV = 0x00200000 |
| 1126 | QHOT = 0x00400000 |
| 1127 | QNEXTHOT = 0x00800000 |
| 1128 | _QINSERTING = 0x04000000 |
| 1129 | _QREMOVING = 0x08000000 |
| 1130 | Q_SQQUEUED = 0x01 |
| 1131 | Q_SQDRAINING = 0x02 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1132 | QB_FULL = 0x01 |
| 1133 | QB_WANTW = 0x02 |
| 1134 | QB_BACK = 0x04 |
| 1135 | NBAND = 256 |
| 1136 | STRUIOT_NONE = -1 |
| 1137 | STRUIOT_DONTCARE = 0 |
| 1138 | STRUIOT_STANDARD = 1 |
| 1139 | STRUIOT_IP = 2 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1140 | DBLK_REFMIN = 0x01 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1141 | STRUIO_SPEC = 0x01 |
| 1142 | STRUIO_DONE = 0x02 |
| 1143 | STRUIO_IP = 0x04 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1144 | STRUIO_ZC = 0x08 |
| 1145 | STRUIO_ICK = 0x10 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1146 | MSGMARK = 0x01 |
| 1147 | MSGNOLOOP = 0x02 |
| 1148 | MSGDELIM = 0x04 |
| 1149 | MSGNOGET = 0x08 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1150 | MSGMARKNEXT = 0x10 |
| 1151 | MSGNOTMARKNEXT = 0x20 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1152 | M_DATA = 0x00 |
| 1153 | M_PROTO = 0x01 |
| 1154 | M_BREAK = 0x08 |
| 1155 | M_PASSFP = 0x09 |
| 1156 | M_EVENT = 0x0a |
| 1157 | M_SIG = 0x0b |
| 1158 | M_DELAY = 0x0c |
| 1159 | M_CTL = 0x0d |
| 1160 | M_IOCTL = 0x0e |
| 1161 | M_SETOPTS = 0x10 |
| 1162 | M_RSE = 0x11 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1163 | M_IOCACK = 0x81 |
| 1164 | M_IOCNAK = 0x82 |
| 1165 | M_PCPROTO = 0x83 |
| 1166 | M_PCSIG = 0x84 |
| 1167 | M_READ = 0x85 |
| 1168 | M_FLUSH = 0x86 |
| 1169 | M_STOP = 0x87 |
| 1170 | M_START = 0x88 |
| 1171 | M_HANGUP = 0x89 |
| 1172 | M_ERROR = 0x8a |
| 1173 | M_COPYIN = 0x8b |
| 1174 | M_COPYOUT = 0x8c |
| 1175 | M_IOCDATA = 0x8d |
| 1176 | M_PCRSE = 0x8e |
| 1177 | M_STOPI = 0x8f |
| 1178 | M_STARTI = 0x90 |
| 1179 | M_PCEVENT = 0x91 |
| 1180 | M_UNHANGUP = 0x92 |
| 1181 | QNORM = 0x00 |
| 1182 | QPCTL = 0x80 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1183 | IOC_MODELS = DATAMODEL_MASK |
| 1184 | IOC_ILP32 = DATAMODEL_ILP32 |
| 1185 | IOC_LP64 = DATAMODEL_LP64 |
| 1186 | IOC_NATIVE = DATAMODEL_NATIVE |
| 1187 | IOC_NONE = DATAMODEL_NONE |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1188 | STRCANON = 0x01 |
| 1189 | RECOPY = 0x02 |
| 1190 | SO_ALL = 0x003f |
| 1191 | SO_READOPT = 0x0001 |
| 1192 | SO_WROFF = 0x0002 |
| 1193 | SO_MINPSZ = 0x0004 |
| 1194 | SO_MAXPSZ = 0x0008 |
| 1195 | SO_HIWAT = 0x0010 |
| 1196 | SO_LOWAT = 0x0020 |
| 1197 | SO_MREADON = 0x0040 |
| 1198 | SO_MREADOFF = 0x0080 |
| 1199 | SO_NDELON = 0x0100 |
| 1200 | SO_NDELOFF = 0x0200 |
| 1201 | SO_ISTTY = 0x0400 |
| 1202 | SO_ISNTTY = 0x0800 |
| 1203 | SO_TOSTOP = 0x1000 |
| 1204 | SO_TONSTOP = 0x2000 |
| 1205 | SO_BAND = 0x4000 |
| 1206 | SO_DELIM = 0x8000 |
| 1207 | SO_NODELIM = 0x010000 |
| 1208 | SO_STRHOLD = 0x020000 |
| 1209 | SO_ERROPT = 0x040000 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1210 | SO_COPYOPT = 0x080000 |
| 1211 | SO_MAXBLK = 0x100000 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1212 | DEF_IOV_MAX = 16 |
| 1213 | INFOD_FIRSTBYTES = 0x02 |
| 1214 | INFOD_BYTES = 0x04 |
| 1215 | INFOD_COUNT = 0x08 |
| 1216 | INFOD_COPYOUT = 0x10 |
| 1217 | MODOPEN = 0x1 |
| 1218 | CLONEOPEN = 0x2 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1219 | CONSOPEN = 0x4 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1220 | OPENFAIL = -1 |
| 1221 | BPRI_LO = 1 |
| 1222 | BPRI_MED = 2 |
| 1223 | BPRI_HI = 3 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1224 | BPRI_FT = 4 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1225 | INFPSZ = -1 |
| 1226 | FLUSHALL = 1 |
| 1227 | FLUSHDATA = 0 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1228 | STRHIGH = 5120 |
| 1229 | STRLOW = 1024 |
| 1230 | MAXIOCBSZ = 1024 |
| 1231 | PERIM_INNER = 1 |
| 1232 | PERIM_OUTER = 2 |
| 1233 | def datamsg(type): return \ |
| 1234 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1235 | def straln(a): return (caddr_t)((intptr_t)(a) & ~(sizeof (int)-1)) |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1236 | |
| 1237 | |
| 1238 | # Included from sys/byteorder.h |
| 1239 | def ntohl(x): return (x) |
| 1240 | |
| 1241 | def ntohs(x): return (x) |
| 1242 | |
| 1243 | def htonl(x): return (x) |
| 1244 | |
| 1245 | def htons(x): return (x) |
| 1246 | |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1247 | IPPROTO_IP = 0 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1248 | IPPROTO_HOPOPTS = 0 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1249 | IPPROTO_ICMP = 1 |
| 1250 | IPPROTO_IGMP = 2 |
| 1251 | IPPROTO_GGP = 3 |
| 1252 | IPPROTO_ENCAP = 4 |
| 1253 | IPPROTO_TCP = 6 |
| 1254 | IPPROTO_EGP = 8 |
| 1255 | IPPROTO_PUP = 12 |
| 1256 | IPPROTO_UDP = 17 |
| 1257 | IPPROTO_IDP = 22 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1258 | IPPROTO_IPV6 = 41 |
| 1259 | IPPROTO_ROUTING = 43 |
| 1260 | IPPROTO_FRAGMENT = 44 |
| 1261 | IPPROTO_RSVP = 46 |
| 1262 | IPPROTO_ESP = 50 |
| 1263 | IPPROTO_AH = 51 |
| 1264 | IPPROTO_ICMPV6 = 58 |
| 1265 | IPPROTO_NONE = 59 |
| 1266 | IPPROTO_DSTOPTS = 60 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1267 | IPPROTO_HELLO = 63 |
| 1268 | IPPROTO_ND = 77 |
| 1269 | IPPROTO_EON = 80 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1270 | IPPROTO_PIM = 103 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1271 | IPPROTO_RAW = 255 |
| 1272 | IPPROTO_MAX = 256 |
| 1273 | IPPORT_ECHO = 7 |
| 1274 | IPPORT_DISCARD = 9 |
| 1275 | IPPORT_SYSTAT = 11 |
| 1276 | IPPORT_DAYTIME = 13 |
| 1277 | IPPORT_NETSTAT = 15 |
| 1278 | IPPORT_FTP = 21 |
| 1279 | IPPORT_TELNET = 23 |
| 1280 | IPPORT_SMTP = 25 |
| 1281 | IPPORT_TIMESERVER = 37 |
| 1282 | IPPORT_NAMESERVER = 42 |
| 1283 | IPPORT_WHOIS = 43 |
| 1284 | IPPORT_MTP = 57 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1285 | IPPORT_BOOTPS = 67 |
| 1286 | IPPORT_BOOTPC = 68 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1287 | IPPORT_TFTP = 69 |
| 1288 | IPPORT_RJE = 77 |
| 1289 | IPPORT_FINGER = 79 |
| 1290 | IPPORT_TTYLINK = 87 |
| 1291 | IPPORT_SUPDUP = 95 |
| 1292 | IPPORT_EXECSERVER = 512 |
| 1293 | IPPORT_LOGINSERVER = 513 |
| 1294 | IPPORT_CMDSERVER = 514 |
| 1295 | IPPORT_EFSSERVER = 520 |
| 1296 | IPPORT_BIFFUDP = 512 |
| 1297 | IPPORT_WHOSERVER = 513 |
| 1298 | IPPORT_ROUTESERVER = 520 |
| 1299 | IPPORT_RESERVED = 1024 |
| 1300 | IPPORT_USERRESERVED = 5000 |
| 1301 | IMPLINK_IP = 155 |
| 1302 | IMPLINK_LOWEXPER = 156 |
| 1303 | IMPLINK_HIGHEXPER = 158 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1304 | IN_CLASSA_NSHIFT = 24 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1305 | IN_CLASSA_MAX = 128 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1306 | IN_CLASSB_NSHIFT = 16 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1307 | IN_CLASSB_MAX = 65536 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1308 | IN_CLASSC_NSHIFT = 8 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1309 | IN_CLASSD_NSHIFT = 28 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1310 | def IN_MULTICAST(i): return IN_CLASSD(i) |
| 1311 | |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1312 | IN_LOOPBACKNET = 127 |
Guido van Rossum | 725a67e | 1997-05-13 17:45:56 +0000 | [diff] [blame] | 1313 | def IN_SET_LOOPBACK_ADDR(a): return \ |
| 1314 | |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1315 | def IN6_IS_ADDR_UNSPECIFIED(addr): return \ |
| 1316 | |
| 1317 | def IN6_IS_ADDR_LOOPBACK(addr): return \ |
| 1318 | |
| 1319 | def IN6_IS_ADDR_LOOPBACK(addr): return \ |
| 1320 | |
| 1321 | def IN6_IS_ADDR_MULTICAST(addr): return \ |
| 1322 | |
| 1323 | def IN6_IS_ADDR_MULTICAST(addr): return \ |
| 1324 | |
| 1325 | def IN6_IS_ADDR_LINKLOCAL(addr): return \ |
| 1326 | |
| 1327 | def IN6_IS_ADDR_LINKLOCAL(addr): return \ |
| 1328 | |
| 1329 | def IN6_IS_ADDR_SITELOCAL(addr): return \ |
| 1330 | |
| 1331 | def IN6_IS_ADDR_SITELOCAL(addr): return \ |
| 1332 | |
| 1333 | def IN6_IS_ADDR_V4MAPPED(addr): return \ |
| 1334 | |
| 1335 | def IN6_IS_ADDR_V4MAPPED(addr): return \ |
| 1336 | |
| 1337 | def IN6_IS_ADDR_V4MAPPED_ANY(addr): return \ |
| 1338 | |
| 1339 | def IN6_IS_ADDR_V4MAPPED_ANY(addr): return \ |
| 1340 | |
| 1341 | def IN6_IS_ADDR_V4COMPAT(addr): return \ |
| 1342 | |
| 1343 | def IN6_IS_ADDR_V4COMPAT(addr): return \ |
| 1344 | |
| 1345 | def IN6_IS_ADDR_MC_RESERVED(addr): return \ |
| 1346 | |
| 1347 | def IN6_IS_ADDR_MC_RESERVED(addr): return \ |
| 1348 | |
| 1349 | def IN6_IS_ADDR_MC_NODELOCAL(addr): return \ |
| 1350 | |
| 1351 | def IN6_IS_ADDR_MC_NODELOCAL(addr): return \ |
| 1352 | |
| 1353 | def IN6_IS_ADDR_MC_LINKLOCAL(addr): return \ |
| 1354 | |
| 1355 | def IN6_IS_ADDR_MC_LINKLOCAL(addr): return \ |
| 1356 | |
| 1357 | def IN6_IS_ADDR_MC_SITELOCAL(addr): return \ |
| 1358 | |
| 1359 | def IN6_IS_ADDR_MC_SITELOCAL(addr): return \ |
| 1360 | |
| 1361 | def IN6_IS_ADDR_MC_ORGLOCAL(addr): return \ |
| 1362 | |
| 1363 | def IN6_IS_ADDR_MC_ORGLOCAL(addr): return \ |
| 1364 | |
| 1365 | def IN6_IS_ADDR_MC_GLOBAL(addr): return \ |
| 1366 | |
| 1367 | def IN6_IS_ADDR_MC_GLOBAL(addr): return \ |
| 1368 | |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1369 | IP_OPTIONS = 1 |
| 1370 | IP_HDRINCL = 2 |
| 1371 | IP_TOS = 3 |
| 1372 | IP_TTL = 4 |
| 1373 | IP_RECVOPTS = 5 |
| 1374 | IP_RECVRETOPTS = 6 |
| 1375 | IP_RECVDSTADDR = 7 |
| 1376 | IP_RETOPTS = 8 |
| 1377 | IP_MULTICAST_IF = 0x10 |
| 1378 | IP_MULTICAST_TTL = 0x11 |
| 1379 | IP_MULTICAST_LOOP = 0x12 |
| 1380 | IP_ADD_MEMBERSHIP = 0x13 |
| 1381 | IP_DROP_MEMBERSHIP = 0x14 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1382 | IP_SEC_OPT = 0x22 |
| 1383 | IPSEC_PREF_NEVER = 0x01 |
| 1384 | IPSEC_PREF_REQUIRED = 0x02 |
| 1385 | IPSEC_PREF_UNIQUE = 0x04 |
| 1386 | IP_ADD_PROXY_ADDR = 0x40 |
| 1387 | IP_BOUND_IF = 0x41 |
| 1388 | IP_UNSPEC_SRC = 0x42 |
| 1389 | IP_REUSEADDR = 0x104 |
| 1390 | IP_DONTROUTE = 0x105 |
| 1391 | IP_BROADCAST = 0x106 |
Guido van Rossum | e5e73b9 | 1994-10-09 23:03:12 +0000 | [diff] [blame] | 1392 | IP_DEFAULT_MULTICAST_TTL = 1 |
| 1393 | IP_DEFAULT_MULTICAST_LOOP = 1 |
Martin v. Löwis | 4414933 | 2001-08-09 12:33:32 +0000 | [diff] [blame] | 1394 | IPV6_RTHDR_TYPE_0 = 0 |
| 1395 | IPV6_UNICAST_HOPS = 0x5 |
| 1396 | IPV6_MULTICAST_IF = 0x6 |
| 1397 | IPV6_MULTICAST_HOPS = 0x7 |
| 1398 | IPV6_MULTICAST_LOOP = 0x8 |
| 1399 | IPV6_JOIN_GROUP = 0x9 |
| 1400 | IPV6_LEAVE_GROUP = 0xa |
| 1401 | IPV6_ADD_MEMBERSHIP = 0x9 |
| 1402 | IPV6_DROP_MEMBERSHIP = 0xa |
| 1403 | IPV6_PKTINFO = 0xb |
| 1404 | IPV6_HOPLIMIT = 0xc |
| 1405 | IPV6_NEXTHOP = 0xd |
| 1406 | IPV6_HOPOPTS = 0xe |
| 1407 | IPV6_DSTOPTS = 0xf |
| 1408 | IPV6_RTHDR = 0x10 |
| 1409 | IPV6_RTHDRDSTOPTS = 0x11 |
| 1410 | IPV6_RECVPKTINFO = 0x12 |
| 1411 | IPV6_RECVHOPLIMIT = 0x13 |
| 1412 | IPV6_RECVHOPOPTS = 0x14 |
| 1413 | IPV6_RECVDSTOPTS = 0x15 |
| 1414 | IPV6_RECVRTHDR = 0x16 |
| 1415 | IPV6_RECVRTHDRDSTOPTS = 0x17 |
| 1416 | IPV6_CHECKSUM = 0x18 |
| 1417 | IPV6_BOUND_IF = 0x41 |
| 1418 | IPV6_UNSPEC_SRC = 0x42 |
| 1419 | INET_ADDRSTRLEN = 16 |
| 1420 | INET6_ADDRSTRLEN = 46 |
| 1421 | IPV6_PAD1_OPT = 0 |