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 (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 22 /* All Rights Reserved */ 23 24 25 /* 26 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 * 29 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 30 * Copyright 2016 Joyent, Inc. 31 * Copyright 2021 Oxide Computer Company 32 */ 33 34 #ifndef _SYS_TYPES_H 35 #define _SYS_TYPES_H 36 37 #include <sys/feature_tests.h> 38 #include <sys/isa_defs.h> 39 40 /* 41 * Machine dependent definitions moved to <sys/machtypes.h>. 42 */ 43 #include <sys/machtypes.h> 44 45 /* 46 * Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C 47 * committee's working draft for the revision of the current ISO C standard, 48 * ISO/IEC 9899:1990 Programming language - C. These are not currently 49 * required by any standard but constitute a useful, general purpose set 50 * of type definitions which is namespace clean with respect to all standards. 51 */ 52 #ifdef _KERNEL 53 #include <sys/inttypes.h> 54 #else /* _KERNEL */ 55 #include <sys/int_types.h> 56 #endif /* _KERNEL */ 57 58 #if defined(_KERNEL) || defined(_SYSCALL32) 59 #include <sys/types32.h> 60 #endif 61 62 #ifdef __cplusplus 63 extern "C" { 64 #endif 65 66 /* 67 * Strictly conforming ANSI C environments prior to the 1999 68 * revision of the C Standard (ISO/IEC 9899:1999) do not have 69 * the long long data type. 70 */ 71 #if defined(_LONGLONG_TYPE) 72 typedef long long longlong_t; 73 typedef unsigned long long u_longlong_t; 74 #else 75 /* used to reserve space and generate alignment */ 76 typedef union { 77 double _d; 78 int32_t _l[2]; 79 } longlong_t; 80 typedef union { 81 double _d; 82 uint32_t _l[2]; 83 } u_longlong_t; 84 #endif /* defined(_LONGLONG_TYPE) */ 85 86 /* 87 * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had 88 * to use them instead of int32_t and uint32_t because DEC had 89 * shipped 64-bit wide. 90 */ 91 #if defined(_LP64) || defined(_I32LPx) 92 typedef int32_t t_scalar_t; 93 typedef uint32_t t_uscalar_t; 94 #else 95 typedef long t_scalar_t; /* historical versions */ 96 typedef unsigned long t_uscalar_t; 97 #endif /* defined(_LP64) || defined(_I32LPx) */ 98 99 /* 100 * POSIX Extensions 101 */ 102 typedef unsigned char uchar_t; 103 typedef unsigned short ushort_t; 104 typedef unsigned int uint_t; 105 typedef unsigned long ulong_t; 106 107 typedef char *caddr_t; /* ?<core address> type */ 108 typedef long daddr_t; /* <disk address> type */ 109 typedef short cnt_t; /* ?<count> type */ 110 111 #if !defined(_PTRDIFF_T) || __cplusplus >= 199711L 112 #define _PTRDIFF_T 113 #if defined(_LP64) || defined(_I32LPx) 114 typedef long ptrdiff_t; /* pointer difference */ 115 #else 116 typedef int ptrdiff_t; /* (historical version) */ 117 #endif 118 #endif 119 120 /* 121 * VM-related types 122 */ 123 typedef ulong_t pfn_t; /* page frame number */ 124 typedef ulong_t pgcnt_t; /* number of pages */ 125 typedef long spgcnt_t; /* signed number of pages */ 126 127 typedef uchar_t use_t; /* use count for swap. */ 128 typedef short sysid_t; 129 typedef short index_t; 130 typedef void *timeout_id_t; /* opaque handle from timeout(9F) */ 131 typedef void *bufcall_id_t; /* opaque handle from bufcall(9F) */ 132 133 /* 134 * The size of off_t and related types depends on the setting of 135 * _FILE_OFFSET_BITS. (Note that other system headers define other types 136 * related to those defined here.) 137 * 138 * If _LARGEFILE64_SOURCE is defined, variants of these types that are 139 * explicitly 64 bits wide become available. 140 */ 141 #ifndef _OFF_T 142 #define _OFF_T 143 144 #if defined(_LP64) || _FILE_OFFSET_BITS == 32 145 typedef long off_t; /* offsets within files */ 146 #elif _FILE_OFFSET_BITS == 64 147 typedef longlong_t off_t; /* offsets within files */ 148 #endif 149 150 #if defined(_LARGEFILE64_SOURCE) 151 #ifdef _LP64 152 typedef off_t off64_t; /* offsets within files */ 153 #else 154 typedef longlong_t off64_t; /* offsets within files */ 155 #endif 156 #endif /* _LARGEFILE64_SOURCE */ 157 158 #endif /* _OFF_T */ 159 160 #if defined(_LP64) || _FILE_OFFSET_BITS == 32 161 typedef ulong_t ino_t; /* expanded inode type */ 162 typedef long blkcnt_t; /* count of file blocks */ 163 typedef ulong_t fsblkcnt_t; /* count of file system blocks */ 164 typedef ulong_t fsfilcnt_t; /* count of files */ 165 #elif _FILE_OFFSET_BITS == 64 166 typedef u_longlong_t ino_t; /* expanded inode type */ 167 typedef longlong_t blkcnt_t; /* count of file blocks */ 168 typedef u_longlong_t fsblkcnt_t; /* count of file system blocks */ 169 typedef u_longlong_t fsfilcnt_t; /* count of files */ 170 #endif 171 172 #if defined(_LARGEFILE64_SOURCE) 173 #ifdef _LP64 174 typedef ino_t ino64_t; /* expanded inode type */ 175 typedef blkcnt_t blkcnt64_t; /* count of file blocks */ 176 typedef fsblkcnt_t fsblkcnt64_t; /* count of file system blocks */ 177 typedef fsfilcnt_t fsfilcnt64_t; /* count of files */ 178 #else 179 typedef u_longlong_t ino64_t; /* expanded inode type */ 180 typedef longlong_t blkcnt64_t; /* count of file blocks */ 181 typedef u_longlong_t fsblkcnt64_t; /* count of file system blocks */ 182 typedef u_longlong_t fsfilcnt64_t; /* count of files */ 183 #endif 184 #endif /* _LARGEFILE64_SOURCE */ 185 186 #ifdef _LP64 187 typedef int blksize_t; /* used for block sizes */ 188 #else 189 typedef long blksize_t; /* used for block sizes */ 190 #endif 191 192 /* 193 * The boolean_t type has had a varied amount of exposure over the years in 194 * terms of how its enumeration constants have been exposed. In particular, it 195 * originally used the __XOPEN_OR_POSIX macro to determine whether to prefix the 196 * B_TRUE and B_FALSE with an underscore. This check never included the 197 * question of if we were in a strict ANSI C environment or whether extensions 198 * were defined. 199 * 200 * Compilers such as clang started defaulting to always including an 201 * XOPEN_SOURCE declaration on behalf of users, but also noted __EXTENSIONS__. 202 * This would lead most software that had used the non-underscore versions to 203 * need it. As such, we have adjusted the non-strict XOPEN environment to retain 204 * its old behavior so as to minimize namespace pollution; however, we instead 205 * include both variants of the definitions in the generally visible version 206 * allowing software written in either world to hopefully end up in a good 207 * place. 208 * 209 * This isn't perfect, but should hopefully minimize the pain for folks actually 210 * trying to build software. 211 */ 212 #if defined(__XOPEN_OR_POSIX) && !defined(__EXTENSIONS__) 213 typedef enum { _B_FALSE, _B_TRUE } boolean_t; 214 #else 215 typedef enum { B_FALSE = 0, B_TRUE = 1, _B_FALSE = 0, _B_TRUE = 1 } boolean_t; 216 #endif /* __XOPEN_OR_POSIX && !__EXTENSIONS__ */ 217 218 #ifdef _KERNEL 219 #define VALID_BOOLEAN(x) (((x) == B_FALSE) || ((x) == B_TRUE)) 220 #define VOID2BOOLEAN(x) (((uintptr_t)(x) == 0) ? B_FALSE : B_TRUE) 221 #endif /* _KERNEL */ 222 223 #ifdef _KERNEL 224 #define BOOLEAN2VOID(x) ((x) ? 1 : 0) 225 #endif /* _KERNEL */ 226 227 /* 228 * The {u,}pad64_t types can be used in structures such that those structures 229 * may be accessed by code produced by compilation environments which don't 230 * support a 64 bit integral datatype. The intention is not to allow 231 * use of these fields in such environments, but to maintain the alignment 232 * and offsets of the structure. 233 * 234 * Similar comments for {u,}pad128_t. 235 * 236 * Note that these types do NOT generate any stronger alignment constraints 237 * than those available in the underlying ABI. See <sys/isa_defs.h> 238 */ 239 #if defined(_INT64_TYPE) 240 typedef int64_t pad64_t; 241 typedef uint64_t upad64_t; 242 #else 243 typedef union { 244 double _d; 245 int32_t _l[2]; 246 } pad64_t; 247 248 typedef union { 249 double _d; 250 uint32_t _l[2]; 251 } upad64_t; 252 #endif 253 254 typedef union { 255 long double _q; 256 int32_t _l[4]; 257 } pad128_t; 258 259 typedef union { 260 long double _q; 261 uint32_t _l[4]; 262 } upad128_t; 263 264 typedef longlong_t offset_t; 265 typedef u_longlong_t u_offset_t; 266 typedef u_longlong_t len_t; 267 typedef u_longlong_t diskaddr_t; 268 #if (defined(_KERNEL) || defined(_KMEMUSER) || defined(_BOOT)) 269 typedef uint64_t paddr_t; 270 #endif 271 272 /* 273 * Definitions remaining from previous partial support for 64-bit file 274 * offsets. This partial support for devices greater than 2gb requires 275 * compiler support for long long. 276 */ 277 #ifdef _LONG_LONG_LTOH 278 typedef union { 279 offset_t _f; /* Full 64 bit offset value */ 280 struct { 281 int32_t _l; /* lower 32 bits of offset value */ 282 int32_t _u; /* upper 32 bits of offset value */ 283 } _p; 284 } lloff_t; 285 #endif 286 287 #ifdef _LONG_LONG_HTOL 288 typedef union { 289 offset_t _f; /* Full 64 bit offset value */ 290 struct { 291 int32_t _u; /* upper 32 bits of offset value */ 292 int32_t _l; /* lower 32 bits of offset value */ 293 } _p; 294 } lloff_t; 295 #endif 296 297 #ifdef _LONG_LONG_LTOH 298 typedef union { 299 longlong_t _f; /* Full 64 bit disk address value */ 300 struct { 301 int32_t _l; /* lower 32 bits of disk address value */ 302 int32_t _u; /* upper 32 bits of disk address value */ 303 } _p; 304 } lldaddr_t; 305 #endif 306 307 #ifdef _LONG_LONG_HTOL 308 typedef union { 309 longlong_t _f; /* Full 64 bit disk address value */ 310 struct { 311 int32_t _u; /* upper 32 bits of disk address value */ 312 int32_t _l; /* lower 32 bits of disk address value */ 313 } _p; 314 } lldaddr_t; 315 #endif 316 317 typedef uint_t k_fltset_t; /* kernel fault set type */ 318 319 /* 320 * The following type is for various kinds of identifiers. The 321 * actual type must be the same for all since some system calls 322 * (such as sigsend) take arguments that may be any of these 323 * types. The enumeration type idtype_t defined in sys/procset.h 324 * is used to indicate what type of id is being specified -- 325 * a process id, process group id, session id, scheduling class id, 326 * user id, group id, project id, task id or zone id. 327 */ 328 #if defined(_LP64) || defined(_I32LPx) 329 typedef int id_t; 330 #else 331 typedef long id_t; /* (historical version) */ 332 #endif 333 334 typedef id_t lgrp_id_t; /* lgroup ID */ 335 336 /* 337 * Type useconds_t is an unsigned integral type capable of storing 338 * values at least in the range of zero to 1,000,000. 339 */ 340 typedef uint_t useconds_t; /* Time, in microseconds */ 341 342 #ifndef _SUSECONDS_T 343 #define _SUSECONDS_T 344 typedef long suseconds_t; /* signed # of microseconds */ 345 #endif /* _SUSECONDS_T */ 346 347 /* 348 * Typedefs for dev_t components. 349 */ 350 #if defined(_LP64) || defined(_I32LPx) 351 typedef uint_t major_t; /* major part of device number */ 352 typedef uint_t minor_t; /* minor part of device number */ 353 #else 354 typedef ulong_t major_t; /* (historical version) */ 355 typedef ulong_t minor_t; /* (historical version) */ 356 #endif 357 358 /* 359 * The data type of a thread priority. 360 */ 361 typedef short pri_t; 362 363 /* 364 * The data type for a CPU flags field. (Can be extended to larger unsigned 365 * types, if needed, limited by ability to update atomically.) 366 */ 367 typedef ushort_t cpu_flag_t; 368 369 /* 370 * For compatibility reasons the following typedefs (prefixed o_) 371 * can't grow regardless of the EFT definition. Although, 372 * applications should not explicitly use these typedefs 373 * they may be included via a system header definition. 374 * WARNING: These typedefs may be removed in a future 375 * release. 376 * ex. the definitions in s5inode.h (now obsoleted) 377 * remained small to preserve compatibility 378 * in the S5 file system type. 379 */ 380 typedef ushort_t o_mode_t; /* old file attribute type */ 381 typedef short o_dev_t; /* old device type */ 382 typedef ushort_t o_uid_t; /* old UID type */ 383 typedef o_uid_t o_gid_t; /* old GID type */ 384 typedef short o_nlink_t; /* old file link type */ 385 typedef short o_pid_t; /* old process id type */ 386 typedef ushort_t o_ino_t; /* old inode type */ 387 388 389 /* 390 * POSIX and XOPEN Declarations 391 */ 392 typedef int key_t; /* IPC key type */ 393 #if defined(_LP64) || defined(_I32LPx) 394 typedef uint_t mode_t; /* file attribute type */ 395 #else 396 typedef ulong_t mode_t; /* (historical version) */ 397 #endif 398 399 #ifndef _UID_T 400 #define _UID_T 401 typedef unsigned int uid_t; /* UID type */ 402 #endif /* _UID_T */ 403 404 typedef uid_t gid_t; /* GID type */ 405 406 typedef uint32_t datalink_id_t; 407 typedef uint32_t vrid_t; 408 409 typedef id_t taskid_t; 410 typedef id_t projid_t; 411 typedef id_t poolid_t; 412 typedef id_t zoneid_t; 413 typedef id_t ctid_t; 414 415 /* 416 * POSIX definitions are same as defined in thread.h and synch.h. 417 * Any changes made to here should be reflected in corresponding 418 * files as described in comments. 419 */ 420 typedef uint_t pthread_t; /* = thread_t in thread.h */ 421 typedef uint_t pthread_key_t; /* = thread_key_t in thread.h */ 422 423 /* "Magic numbers" tagging synchronization object types */ 424 #define _MUTEX_MAGIC 0x4d58 /* "MX" */ 425 #define _SEMA_MAGIC 0x534d /* "SM" */ 426 #define _COND_MAGIC 0x4356 /* "CV" */ 427 #define _RWL_MAGIC 0x5257 /* "RW" */ 428 429 typedef struct _pthread_mutex { /* = mutex_t in synch.h */ 430 struct { 431 uint16_t __pthread_mutex_flag1; 432 uint8_t __pthread_mutex_flag2; 433 uint8_t __pthread_mutex_ceiling; 434 uint16_t __pthread_mutex_type; 435 uint16_t __pthread_mutex_magic; 436 } __pthread_mutex_flags; 437 union { 438 struct { 439 uint8_t __pthread_mutex_pad[8]; 440 } __pthread_mutex_lock64; 441 struct { 442 uint32_t __pthread_ownerpid; 443 uint32_t __pthread_lockword; 444 } __pthread_mutex_lock32; 445 upad64_t __pthread_mutex_owner64; 446 } __pthread_mutex_lock; 447 upad64_t __pthread_mutex_data; 448 } pthread_mutex_t; 449 450 typedef struct _pthread_cond { /* = cond_t in synch.h */ 451 struct { 452 uint8_t __pthread_cond_flag[4]; 453 uint16_t __pthread_cond_type; 454 uint16_t __pthread_cond_magic; 455 } __pthread_cond_flags; 456 upad64_t __pthread_cond_data; 457 } pthread_cond_t; 458 459 /* 460 * UNIX 98 Extension 461 */ 462 typedef struct _pthread_rwlock { /* = rwlock_t in synch.h */ 463 int32_t __pthread_rwlock_readers; 464 uint16_t __pthread_rwlock_type; 465 uint16_t __pthread_rwlock_magic; 466 pthread_mutex_t __pthread_rwlock_mutex; 467 pthread_cond_t __pthread_rwlock_readercv; 468 pthread_cond_t __pthread_rwlock_writercv; 469 } pthread_rwlock_t; 470 471 /* 472 * SUSV3 473 */ 474 typedef struct { 475 uint32_t __pthread_barrier_count; 476 uint32_t __pthread_barrier_current; 477 upad64_t __pthread_barrier_cycle; 478 upad64_t __pthread_barrier_reserved; 479 pthread_mutex_t __pthread_barrier_lock; 480 pthread_cond_t __pthread_barrier_cond; 481 } pthread_barrier_t; 482 483 typedef pthread_mutex_t pthread_spinlock_t; 484 485 /* 486 * attributes for threads, dynamically allocated by library 487 */ 488 typedef struct _pthread_attr { 489 void *__pthread_attrp; 490 } pthread_attr_t; 491 492 /* 493 * attributes for mutex, dynamically allocated by library 494 */ 495 typedef struct _pthread_mutexattr { 496 void *__pthread_mutexattrp; 497 } pthread_mutexattr_t; 498 499 /* 500 * attributes for cond, dynamically allocated by library 501 */ 502 typedef struct _pthread_condattr { 503 void *__pthread_condattrp; 504 } pthread_condattr_t; 505 506 /* 507 * pthread_once 508 */ 509 typedef struct _once { 510 upad64_t __pthread_once_pad[4]; 511 } pthread_once_t; 512 513 /* 514 * UNIX 98 Extensions 515 * attributes for rwlock, dynamically allocated by library 516 */ 517 typedef struct _pthread_rwlockattr { 518 void *__pthread_rwlockattrp; 519 } pthread_rwlockattr_t; 520 521 /* 522 * SUSV3 523 * attributes for pthread_barrier_t, dynamically allocated by library 524 */ 525 typedef struct { 526 void *__pthread_barrierattrp; 527 } pthread_barrierattr_t; 528 529 typedef ulong_t dev_t; /* expanded device type */ 530 531 #if defined(_LP64) || defined(_I32LPx) 532 typedef uint_t nlink_t; /* file link type */ 533 typedef int pid_t; /* process id type */ 534 #else 535 typedef ulong_t nlink_t; /* (historical version) */ 536 typedef long pid_t; /* (historical version) */ 537 #endif 538 539 #if !defined(_SIZE_T) || __cplusplus >= 199711L 540 #define _SIZE_T 541 #if defined(_LP64) || defined(_I32LPx) 542 typedef ulong_t size_t; /* size of something in bytes */ 543 #else 544 typedef uint_t size_t; /* (historical version) */ 545 #endif 546 #endif /* _SIZE_T */ 547 548 #ifndef _SSIZE_T 549 #define _SSIZE_T 550 #if defined(_LP64) || defined(_I32LPx) 551 typedef long ssize_t; /* size of something in bytes or -1 */ 552 #else 553 typedef int ssize_t; /* (historical version) */ 554 #endif 555 #endif /* _SSIZE_T */ 556 557 #if !defined(_TIME_T) || __cplusplus >= 199711L 558 #define _TIME_T 559 typedef long time_t; /* time of day in seconds */ 560 #endif /* _TIME_T */ 561 562 #if !defined(_CLOCK_T) || __cplusplus >= 199711L 563 #define _CLOCK_T 564 typedef long clock_t; /* relative time in a specified resolution */ 565 #endif /* ifndef _CLOCK_T */ 566 567 #ifndef _CLOCKID_T 568 #define _CLOCKID_T 569 typedef int clockid_t; /* clock identifier type */ 570 #endif /* ifndef _CLOCKID_T */ 571 572 #ifndef _TIMER_T 573 #define _TIMER_T 574 typedef int timer_t; /* timer identifier type */ 575 #endif /* ifndef _TIMER_T */ 576 577 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 578 579 /* BEGIN CSTYLED */ 580 typedef unsigned char unchar; 581 typedef unsigned short ushort; 582 typedef unsigned int uint; 583 typedef unsigned long ulong; 584 /* END CSTYLED */ 585 586 #if defined(_KERNEL) || defined(_FAKE_KERNEL) 587 588 #define SHRT_MIN (-32768) /* min value of a "short int" */ 589 #define SHRT_MAX 32767 /* max value of a "short int" */ 590 #define USHRT_MAX 65535 /* max of "unsigned short int" */ 591 #define INT_MIN (-2147483647-1) /* min value of an "int" */ 592 #define INT_MAX 2147483647 /* max value of an "int" */ 593 #define UINT_MAX 4294967295U /* max value of an "unsigned int" */ 594 #if defined(_LP64) 595 #define LONG_MIN (-9223372036854775807L-1L) 596 /* min value of a "long int" */ 597 #define LONG_MAX 9223372036854775807L 598 /* max value of a "long int" */ 599 #define ULONG_MAX 18446744073709551615UL 600 /* max of "unsigned long int" */ 601 #else /* _ILP32 */ 602 #define LONG_MIN (-2147483647L-1L) 603 /* min value of a "long int" */ 604 #define LONG_MAX 2147483647L /* max value of a "long int" */ 605 #define ULONG_MAX 4294967295UL /* max of "unsigned long int" */ 606 #endif 607 608 #define LLONG_MIN (-9223372036854775807LL-1LL) 609 /* min of "long long int" */ 610 #define LLONG_MAX 9223372036854775807LL 611 /* max of "long long int" */ 612 #define ULLONG_MAX 18446744073709551615ULL 613 /* max of "unsigned long long int" */ 614 615 #if defined(_LP64) || _FILE_OFFSET_BITS == 32 616 #define OFF_MIN LONG_MIN 617 #define OFF_MAX LONG_MAX 618 #elif _FILE_OFFSET_BITS == 64 619 #define OFF_MIN LLONG_MIN 620 #define OFF_MAX LLONG_MAX 621 #endif /* _LP64 || _FILE_OFFSET_BITS == 32 */ 622 623 #endif /* defined(_KERNEL) */ 624 625 #define P_MYPID ((pid_t)0) 626 627 /* 628 * The following is the value of type id_t to use to indicate the 629 * caller's current id. See procset.h for the type idtype_t 630 * which defines which kind of id is being specified. 631 */ 632 #define P_MYID (-1) 633 #define NOPID (pid_t)(-1) 634 635 #ifndef NODEV 636 #define NODEV (dev_t)(-1l) 637 #ifdef _SYSCALL32 638 #define NODEV32 (dev32_t)(-1) 639 #endif /* _SYSCALL32 */ 640 #endif /* NODEV */ 641 642 /* 643 * The following value of type pfn_t is used to indicate 644 * invalid page frame number. 645 */ 646 #define PFN_INVALID ((pfn_t)-1) 647 #define PFN_SUSPENDED ((pfn_t)-2) 648 649 /* BEGIN CSTYLED */ 650 typedef unsigned char u_char; 651 typedef unsigned short u_short; 652 typedef unsigned int u_int; 653 typedef unsigned long u_long; 654 typedef struct _quad { int val[2]; } quad_t; /* used by UFS */ 655 typedef quad_t quad; /* used by UFS */ 656 /* END CSTYLED */ 657 658 /* 659 * Nested include for BSD/sockets source compatibility. 660 * (The select macros used to be defined here). 661 */ 662 #include <sys/select.h> 663 664 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 665 666 /* 667 * _VOID was defined to be either void or char but this is not 668 * required because previous SunOS compilers have accepted the void 669 * type. However, because many system header and source files use the 670 * void keyword, the volatile keyword, and ANSI C function prototypes, 671 * non-ANSI compilers cannot compile the system anyway. The _VOID macro 672 * should therefore not be used and remains for source compatibility 673 * only. 674 */ 675 /* CSTYLED */ 676 #define _VOID void 677 678 #ifdef __cplusplus 679 } 680 #endif 681 682 #endif /* _SYS_TYPES_H */ 683