xref: /illumos-gate/usr/src/uts/common/sys/types.h (revision 2cb27123907a098a777e39eebc349d73e99a518f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5ae115bc7Smrj  * Common Development and Distribution License (the "License").
6ae115bc7Smrj  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26ae115bc7Smrj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _SYS_TYPES_H
317c478bd9Sstevel@tonic-gate #define	_SYS_TYPES_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
367c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * Machine dependent definitions moved to <sys/machtypes.h>.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate #include <sys/machtypes.h>
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /*
447c478bd9Sstevel@tonic-gate  * Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C
457c478bd9Sstevel@tonic-gate  * committee's working draft for the revision of the current ISO C standard,
467c478bd9Sstevel@tonic-gate  * ISO/IEC 9899:1990 Programming language - C.  These are not currently
477c478bd9Sstevel@tonic-gate  * required by any standard but constitute a useful, general purpose set
487c478bd9Sstevel@tonic-gate  * of type definitions which is namespace clean with respect to all standards.
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
517c478bd9Sstevel@tonic-gate #include <sys/inttypes.h>
527c478bd9Sstevel@tonic-gate #else	/* _KERNEL */
537c478bd9Sstevel@tonic-gate #include <sys/int_types.h>
547c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_SYSCALL32)
577c478bd9Sstevel@tonic-gate #include <sys/types32.h>
587c478bd9Sstevel@tonic-gate #endif
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
617c478bd9Sstevel@tonic-gate extern "C" {
627c478bd9Sstevel@tonic-gate #endif
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /*
657c478bd9Sstevel@tonic-gate  * Strictly conforming ANSI C environments prior to the 1999
667c478bd9Sstevel@tonic-gate  * revision of the C Standard (ISO/IEC 9899:1999) do not have
677c478bd9Sstevel@tonic-gate  * the long long data type.
687c478bd9Sstevel@tonic-gate  */
697c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
707c478bd9Sstevel@tonic-gate typedef	long long		longlong_t;
717c478bd9Sstevel@tonic-gate typedef	unsigned long long	u_longlong_t;
727c478bd9Sstevel@tonic-gate #else
737c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */
747c478bd9Sstevel@tonic-gate typedef union {
757c478bd9Sstevel@tonic-gate 	double	_d;
767c478bd9Sstevel@tonic-gate 	int32_t	_l[2];
777c478bd9Sstevel@tonic-gate } longlong_t;
787c478bd9Sstevel@tonic-gate typedef union {
797c478bd9Sstevel@tonic-gate 	double		_d;
807c478bd9Sstevel@tonic-gate 	uint32_t	_l[2];
817c478bd9Sstevel@tonic-gate } u_longlong_t;
827c478bd9Sstevel@tonic-gate #endif	/* defined(_LONGLONG_TYPE) */
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /*
857c478bd9Sstevel@tonic-gate  * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had
867c478bd9Sstevel@tonic-gate  * to use them instead of int32_t and uint32_t because DEC had
877c478bd9Sstevel@tonic-gate  * shipped 64-bit wide.
887c478bd9Sstevel@tonic-gate  */
897c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
907c478bd9Sstevel@tonic-gate typedef int32_t		t_scalar_t;
917c478bd9Sstevel@tonic-gate typedef uint32_t	t_uscalar_t;
927c478bd9Sstevel@tonic-gate #else
937c478bd9Sstevel@tonic-gate typedef long		t_scalar_t;	/* historical versions */
947c478bd9Sstevel@tonic-gate typedef unsigned long	t_uscalar_t;
957c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_I32LPx) */
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate /*
987c478bd9Sstevel@tonic-gate  * POSIX Extensions
997c478bd9Sstevel@tonic-gate  */
1007c478bd9Sstevel@tonic-gate typedef	unsigned char	uchar_t;
1017c478bd9Sstevel@tonic-gate typedef	unsigned short	ushort_t;
1027c478bd9Sstevel@tonic-gate typedef	unsigned int	uint_t;
1037c478bd9Sstevel@tonic-gate typedef	unsigned long	ulong_t;
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate typedef	char		*caddr_t;	/* ?<core address> type */
1067c478bd9Sstevel@tonic-gate typedef	long		daddr_t;	/* <disk address> type */
1077c478bd9Sstevel@tonic-gate typedef	short		cnt_t;		/* ?<count> type */
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate #if !defined(_PTRDIFF_T) || __cplusplus >= 199711L
1107c478bd9Sstevel@tonic-gate #define	_PTRDIFF_T
1117c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
1127c478bd9Sstevel@tonic-gate typedef	long	ptrdiff_t;		/* pointer difference */
1137c478bd9Sstevel@tonic-gate #else
1147c478bd9Sstevel@tonic-gate typedef	int	ptrdiff_t;		/* (historical version) */
1157c478bd9Sstevel@tonic-gate #endif
1167c478bd9Sstevel@tonic-gate #endif
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * VM-related types
1207c478bd9Sstevel@tonic-gate  */
1217c478bd9Sstevel@tonic-gate typedef	ulong_t		pfn_t;		/* page frame number */
1227c478bd9Sstevel@tonic-gate typedef	ulong_t		pgcnt_t;	/* number of pages */
1237c478bd9Sstevel@tonic-gate typedef	long		spgcnt_t;	/* signed number of pages */
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate typedef	uchar_t		use_t;		/* use count for swap.  */
1267c478bd9Sstevel@tonic-gate typedef	short		sysid_t;
1277c478bd9Sstevel@tonic-gate typedef	short		index_t;
1287c478bd9Sstevel@tonic-gate typedef void		*timeout_id_t;	/* opaque handle from timeout(9F) */
1297c478bd9Sstevel@tonic-gate typedef void		*bufcall_id_t;	/* opaque handle from bufcall(9F) */
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate /*
1327c478bd9Sstevel@tonic-gate  * The size of off_t and related types depends on the setting of
1337c478bd9Sstevel@tonic-gate  * _FILE_OFFSET_BITS.  (Note that other system headers define other types
1347c478bd9Sstevel@tonic-gate  * related to those defined here.)
1357c478bd9Sstevel@tonic-gate  *
1367c478bd9Sstevel@tonic-gate  * If _LARGEFILE64_SOURCE is defined, variants of these types that are
1377c478bd9Sstevel@tonic-gate  * explicitly 64 bits wide become available.
1387c478bd9Sstevel@tonic-gate  */
1397c478bd9Sstevel@tonic-gate #ifndef _OFF_T
1407c478bd9Sstevel@tonic-gate #define	_OFF_T
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
1437c478bd9Sstevel@tonic-gate typedef long		off_t;		/* offsets within files */
1447c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64
1457c478bd9Sstevel@tonic-gate typedef longlong_t	off_t;		/* offsets within files */
1467c478bd9Sstevel@tonic-gate #endif
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #if defined(_LARGEFILE64_SOURCE)
1497c478bd9Sstevel@tonic-gate #ifdef _LP64
1507c478bd9Sstevel@tonic-gate typedef	off_t		off64_t;	/* offsets within files */
1517c478bd9Sstevel@tonic-gate #else
1527c478bd9Sstevel@tonic-gate typedef longlong_t	off64_t;	/* offsets within files */
1537c478bd9Sstevel@tonic-gate #endif
1547c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE */
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #endif /* _OFF_T */
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
1597c478bd9Sstevel@tonic-gate typedef ulong_t		ino_t;		/* expanded inode type	*/
1607c478bd9Sstevel@tonic-gate typedef long		blkcnt_t;	/* count of file blocks */
1617c478bd9Sstevel@tonic-gate typedef ulong_t		fsblkcnt_t;	/* count of file system blocks */
1627c478bd9Sstevel@tonic-gate typedef ulong_t		fsfilcnt_t;	/* count of files */
1637c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64
1647c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino_t;		/* expanded inode type	*/
1657c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt_t;	/* count of file blocks */
1667c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt_t;	/* count of file system blocks */
1677c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt_t;	/* count of files */
1687c478bd9Sstevel@tonic-gate #endif
1697c478bd9Sstevel@tonic-gate 
1707c478bd9Sstevel@tonic-gate #if defined(_LARGEFILE64_SOURCE)
1717c478bd9Sstevel@tonic-gate #ifdef _LP64
1727c478bd9Sstevel@tonic-gate typedef	ino_t		ino64_t;	/* expanded inode type */
1737c478bd9Sstevel@tonic-gate typedef	blkcnt_t	blkcnt64_t;	/* count of file blocks */
1747c478bd9Sstevel@tonic-gate typedef	fsblkcnt_t	fsblkcnt64_t;	/* count of file system blocks */
1757c478bd9Sstevel@tonic-gate typedef	fsfilcnt_t	fsfilcnt64_t;	/* count of files */
1767c478bd9Sstevel@tonic-gate #else
1777c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino64_t;	/* expanded inode type	*/
1787c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt64_t;	/* count of file blocks */
1797c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt64_t;	/* count of file system blocks */
1807c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt64_t;	/* count of files */
1817c478bd9Sstevel@tonic-gate #endif
1827c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE */
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate #ifdef _LP64
1857c478bd9Sstevel@tonic-gate typedef	int		blksize_t;	/* used for block sizes */
1867c478bd9Sstevel@tonic-gate #else
1877c478bd9Sstevel@tonic-gate typedef	long		blksize_t;	/* used for block sizes */
1887c478bd9Sstevel@tonic-gate #endif
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate #if defined(__XOPEN_OR_POSIX)
1917c478bd9Sstevel@tonic-gate typedef enum { _B_FALSE, _B_TRUE } boolean_t;
1927c478bd9Sstevel@tonic-gate #else
1937c478bd9Sstevel@tonic-gate typedef enum { B_FALSE, B_TRUE } boolean_t;
1947c478bd9Sstevel@tonic-gate #endif /* defined(__XOPEN_OR_POSIX) */
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate /*
1977c478bd9Sstevel@tonic-gate  * The {u,}pad64_t types can be used in structures such that those structures
1987c478bd9Sstevel@tonic-gate  * may be accessed by code produced by compilation environments which don't
1997c478bd9Sstevel@tonic-gate  * support a 64 bit integral datatype.  The intention is not to allow
2007c478bd9Sstevel@tonic-gate  * use of these fields in such environments, but to maintain the alignment
2017c478bd9Sstevel@tonic-gate  * and offsets of the structure.
2027c478bd9Sstevel@tonic-gate  *
2037c478bd9Sstevel@tonic-gate  * Similar comments for {u,}pad128_t.
2047c478bd9Sstevel@tonic-gate  *
2057c478bd9Sstevel@tonic-gate  * Note that these types do NOT generate any stronger alignment constraints
2067c478bd9Sstevel@tonic-gate  * than those available in the underlying ABI.  See <sys/isa_defs.h>
2077c478bd9Sstevel@tonic-gate  */
2087c478bd9Sstevel@tonic-gate #if defined(_INT64_TYPE)
2097c478bd9Sstevel@tonic-gate typedef int64_t		pad64_t;
2107c478bd9Sstevel@tonic-gate typedef	uint64_t	upad64_t;
2117c478bd9Sstevel@tonic-gate #else
2127c478bd9Sstevel@tonic-gate typedef union {
2137c478bd9Sstevel@tonic-gate 	double   _d;
2147c478bd9Sstevel@tonic-gate 	int32_t  _l[2];
2157c478bd9Sstevel@tonic-gate } pad64_t;
2167c478bd9Sstevel@tonic-gate 
2177c478bd9Sstevel@tonic-gate typedef union {
2187c478bd9Sstevel@tonic-gate 	double   _d;
2197c478bd9Sstevel@tonic-gate 	uint32_t _l[2];
2207c478bd9Sstevel@tonic-gate } upad64_t;
2217c478bd9Sstevel@tonic-gate #endif
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate typedef union {
2247c478bd9Sstevel@tonic-gate 	long double	_q;
2257c478bd9Sstevel@tonic-gate 	int32_t		_l[4];
2267c478bd9Sstevel@tonic-gate } pad128_t;
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate typedef union {
2297c478bd9Sstevel@tonic-gate 	long double	_q;
2307c478bd9Sstevel@tonic-gate 	uint32_t	_l[4];
2317c478bd9Sstevel@tonic-gate } upad128_t;
2327c478bd9Sstevel@tonic-gate 
2337c478bd9Sstevel@tonic-gate typedef	longlong_t	offset_t;
2347c478bd9Sstevel@tonic-gate typedef	u_longlong_t	u_offset_t;
2357c478bd9Sstevel@tonic-gate typedef u_longlong_t	len_t;
2367c478bd9Sstevel@tonic-gate typedef	u_longlong_t	diskaddr_t;
237ae115bc7Smrj #if (defined(_KERNEL) || defined(_KMEMUSER) || defined(_BOOT))
2387c478bd9Sstevel@tonic-gate typedef	uint64_t	paddr_t;
2397c478bd9Sstevel@tonic-gate #endif
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate /*
2427c478bd9Sstevel@tonic-gate  * Definitions remaining from previous partial support for 64-bit file
2437c478bd9Sstevel@tonic-gate  * offsets.  This partial support for devices greater than 2gb requires
2447c478bd9Sstevel@tonic-gate  * compiler support for long long.
2457c478bd9Sstevel@tonic-gate  */
2467c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
2477c478bd9Sstevel@tonic-gate typedef union {
2487c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
2497c478bd9Sstevel@tonic-gate 	struct {
2507c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of offset value */
2517c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of offset value */
2527c478bd9Sstevel@tonic-gate 	} _p;
2537c478bd9Sstevel@tonic-gate } lloff_t;
2547c478bd9Sstevel@tonic-gate #endif
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
2577c478bd9Sstevel@tonic-gate typedef union {
2587c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
2597c478bd9Sstevel@tonic-gate 	struct {
2607c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of offset value */
2617c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of offset value */
2627c478bd9Sstevel@tonic-gate 	} _p;
2637c478bd9Sstevel@tonic-gate } lloff_t;
2647c478bd9Sstevel@tonic-gate #endif
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
2677c478bd9Sstevel@tonic-gate typedef union {
2687c478bd9Sstevel@tonic-gate 	longlong_t	_f;	/* Full 64 bit disk address value */
2697c478bd9Sstevel@tonic-gate 	struct {
2707c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of disk address value */
2717c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of disk address value */
2727c478bd9Sstevel@tonic-gate 	} _p;
2737c478bd9Sstevel@tonic-gate } lldaddr_t;
2747c478bd9Sstevel@tonic-gate #endif
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
2777c478bd9Sstevel@tonic-gate typedef union {
2787c478bd9Sstevel@tonic-gate 	longlong_t	_f;	/* Full 64 bit disk address value */
2797c478bd9Sstevel@tonic-gate 	struct {
2807c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of disk address value */
2817c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of disk address value */
2827c478bd9Sstevel@tonic-gate 	} _p;
2837c478bd9Sstevel@tonic-gate } lldaddr_t;
2847c478bd9Sstevel@tonic-gate #endif
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate typedef uint_t k_fltset_t;	/* kernel fault set type */
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate /*
2897c478bd9Sstevel@tonic-gate  * The following type is for various kinds of identifiers.  The
2907c478bd9Sstevel@tonic-gate  * actual type must be the same for all since some system calls
2917c478bd9Sstevel@tonic-gate  * (such as sigsend) take arguments that may be any of these
2927c478bd9Sstevel@tonic-gate  * types.  The enumeration type idtype_t defined in sys/procset.h
2937c478bd9Sstevel@tonic-gate  * is used to indicate what type of id is being specified --
2947c478bd9Sstevel@tonic-gate  * a process id, process group id, session id, scheduling class id,
2957c478bd9Sstevel@tonic-gate  * user id, group id, project id, task id or zone id.
2967c478bd9Sstevel@tonic-gate  */
2977c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
2987c478bd9Sstevel@tonic-gate typedef int		id_t;
2997c478bd9Sstevel@tonic-gate #else
3007c478bd9Sstevel@tonic-gate typedef	long		id_t;		/* (historical version) */
3017c478bd9Sstevel@tonic-gate #endif
3027c478bd9Sstevel@tonic-gate 
303*2cb27123Saguzovsk typedef id_t		lgrp_id_t;	/* lgroup ID */
304*2cb27123Saguzovsk 
3057c478bd9Sstevel@tonic-gate /*
3067c478bd9Sstevel@tonic-gate  * Type useconds_t is an unsigned integral type capable of storing
3077c478bd9Sstevel@tonic-gate  * values at least in the range of zero to 1,000,000.
3087c478bd9Sstevel@tonic-gate  */
3097c478bd9Sstevel@tonic-gate typedef uint_t		useconds_t;	/* Time, in microseconds */
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate #ifndef	_SUSECONDS_T
3127c478bd9Sstevel@tonic-gate #define	_SUSECONDS_T
3137c478bd9Sstevel@tonic-gate typedef long	suseconds_t;	/* signed # of microseconds */
3147c478bd9Sstevel@tonic-gate #endif	/* _SUSECONDS_T */
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate /*
3177c478bd9Sstevel@tonic-gate  * Typedefs for dev_t components.
3187c478bd9Sstevel@tonic-gate  */
3197c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
3207c478bd9Sstevel@tonic-gate typedef uint_t	major_t;	/* major part of device number */
3217c478bd9Sstevel@tonic-gate typedef uint_t	minor_t;	/* minor part of device number */
3227c478bd9Sstevel@tonic-gate #else
3237c478bd9Sstevel@tonic-gate typedef ulong_t	major_t;	/* (historical version) */
3247c478bd9Sstevel@tonic-gate typedef ulong_t	minor_t;	/* (historical version) */
3257c478bd9Sstevel@tonic-gate #endif
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  * The data type of a thread priority.
3297c478bd9Sstevel@tonic-gate  */
3307c478bd9Sstevel@tonic-gate typedef short	pri_t;
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate /*
3337c478bd9Sstevel@tonic-gate  * The data type for a CPU flags field.  (Can be extended to larger unsigned
3347c478bd9Sstevel@tonic-gate  * types, if needed, limited by ability to update atomically.)
3357c478bd9Sstevel@tonic-gate  */
3367c478bd9Sstevel@tonic-gate typedef ushort_t	cpu_flag_t;
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate /*
3397c478bd9Sstevel@tonic-gate  * For compatibility reasons the following typedefs (prefixed o_)
3407c478bd9Sstevel@tonic-gate  * can't grow regardless of the EFT definition. Although,
3417c478bd9Sstevel@tonic-gate  * applications should not explicitly use these typedefs
3427c478bd9Sstevel@tonic-gate  * they may be included via a system header definition.
3437c478bd9Sstevel@tonic-gate  * WARNING: These typedefs may be removed in a future
3447c478bd9Sstevel@tonic-gate  * release.
3457c478bd9Sstevel@tonic-gate  *		ex. the definitions in s5inode.h (now obsoleted)
3467c478bd9Sstevel@tonic-gate  *			remained small to preserve compatibility
3477c478bd9Sstevel@tonic-gate  *			in the S5 file system type.
3487c478bd9Sstevel@tonic-gate  */
3497c478bd9Sstevel@tonic-gate typedef	ushort_t o_mode_t;		/* old file attribute type */
3507c478bd9Sstevel@tonic-gate typedef short	o_dev_t;		/* old device type	*/
3517c478bd9Sstevel@tonic-gate typedef	ushort_t o_uid_t;		/* old UID type		*/
3527c478bd9Sstevel@tonic-gate typedef	o_uid_t	o_gid_t;		/* old GID type		*/
3537c478bd9Sstevel@tonic-gate typedef	short	o_nlink_t;		/* old file link type	*/
3547c478bd9Sstevel@tonic-gate typedef short	o_pid_t;		/* old process id type	*/
3557c478bd9Sstevel@tonic-gate typedef ushort_t o_ino_t;		/* old inode type	*/
3567c478bd9Sstevel@tonic-gate 
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate /*
3597c478bd9Sstevel@tonic-gate  * POSIX and XOPEN Declarations
3607c478bd9Sstevel@tonic-gate  */
3617c478bd9Sstevel@tonic-gate typedef	int	key_t;			/* IPC key type		*/
3627c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
3637c478bd9Sstevel@tonic-gate typedef	uint_t	mode_t;			/* file attribute type	*/
3647c478bd9Sstevel@tonic-gate #else
3657c478bd9Sstevel@tonic-gate typedef	ulong_t	mode_t;			/* (historical version) */
3667c478bd9Sstevel@tonic-gate #endif
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate #ifndef	_UID_T
3697c478bd9Sstevel@tonic-gate #define	_UID_T
370f48205beScasper typedef	unsigned int uid_t;		/* UID type		*/
3717c478bd9Sstevel@tonic-gate #endif	/* _UID_T */
3727c478bd9Sstevel@tonic-gate 
3737c478bd9Sstevel@tonic-gate typedef	uid_t	gid_t;			/* GID type		*/
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate typedef id_t    taskid_t;
3767c478bd9Sstevel@tonic-gate typedef id_t    projid_t;
3777c478bd9Sstevel@tonic-gate typedef	id_t	poolid_t;
3787c478bd9Sstevel@tonic-gate typedef id_t	zoneid_t;
3797c478bd9Sstevel@tonic-gate typedef id_t	ctid_t;
3807c478bd9Sstevel@tonic-gate 
3817c478bd9Sstevel@tonic-gate /*
3827c478bd9Sstevel@tonic-gate  * POSIX definitions are same as defined in thread.h and synch.h.
3837c478bd9Sstevel@tonic-gate  * Any changes made to here should be reflected in corresponding
3847c478bd9Sstevel@tonic-gate  * files as described in comments.
3857c478bd9Sstevel@tonic-gate  */
3867c478bd9Sstevel@tonic-gate typedef	uint_t	pthread_t;	/* = thread_t in thread.h */
3877c478bd9Sstevel@tonic-gate typedef	uint_t	pthread_key_t;	/* = thread_key_t in thread.h */
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate /* "Magic numbers" tagging synchronization object types */
3907c478bd9Sstevel@tonic-gate #define	_MUTEX_MAGIC	0x4d58		/* "MX" */
3917c478bd9Sstevel@tonic-gate #define	_SEMA_MAGIC	0x534d		/* "SM" */
3927c478bd9Sstevel@tonic-gate #define	_COND_MAGIC	0x4356		/* "CV" */
3937c478bd9Sstevel@tonic-gate #define	_RWL_MAGIC	0x5257		/* "RW" */
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate typedef	struct _pthread_mutex {		/* = mutex_t in synch.h */
3967c478bd9Sstevel@tonic-gate 	struct {
3977c478bd9Sstevel@tonic-gate 		uint16_t	__pthread_mutex_flag1;
3987c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_mutex_flag2;
3997c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_mutex_ceiling;
4007c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_mutex_type;
4017c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_mutex_magic;
4027c478bd9Sstevel@tonic-gate 	} __pthread_mutex_flags;
4037c478bd9Sstevel@tonic-gate 	union {
4047c478bd9Sstevel@tonic-gate 		struct {
4057c478bd9Sstevel@tonic-gate 			uint8_t	__pthread_mutex_pad[8];
4067c478bd9Sstevel@tonic-gate 		} __pthread_mutex_lock64;
4077c478bd9Sstevel@tonic-gate 		struct {
4087c478bd9Sstevel@tonic-gate 			uint32_t __pthread_ownerpid;
4097c478bd9Sstevel@tonic-gate 			uint32_t __pthread_lockword;
4107c478bd9Sstevel@tonic-gate 		} __pthread_mutex_lock32;
4117c478bd9Sstevel@tonic-gate 		upad64_t __pthread_mutex_owner64;
4127c478bd9Sstevel@tonic-gate 	} __pthread_mutex_lock;
4137c478bd9Sstevel@tonic-gate 	upad64_t __pthread_mutex_data;
4147c478bd9Sstevel@tonic-gate } pthread_mutex_t;
4157c478bd9Sstevel@tonic-gate 
4167c478bd9Sstevel@tonic-gate typedef	struct _pthread_cond {		/* = cond_t in synch.h */
4177c478bd9Sstevel@tonic-gate 	struct {
4187c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_cond_flag[4];
4197c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_cond_type;
4207c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_cond_magic;
4217c478bd9Sstevel@tonic-gate 	} __pthread_cond_flags;
4227c478bd9Sstevel@tonic-gate 	upad64_t __pthread_cond_data;
4237c478bd9Sstevel@tonic-gate } pthread_cond_t;
4247c478bd9Sstevel@tonic-gate 
4257c478bd9Sstevel@tonic-gate /*
4267c478bd9Sstevel@tonic-gate  * UNIX 98 Extension
4277c478bd9Sstevel@tonic-gate  */
4287c478bd9Sstevel@tonic-gate typedef	struct _pthread_rwlock {	/* = rwlock_t in synch.h */
4297c478bd9Sstevel@tonic-gate 	int32_t		__pthread_rwlock_readers;
4307c478bd9Sstevel@tonic-gate 	uint16_t	__pthread_rwlock_type;
4317c478bd9Sstevel@tonic-gate 	uint16_t	__pthread_rwlock_magic;
4327c478bd9Sstevel@tonic-gate 	pthread_mutex_t	__pthread_rwlock_mutex;
4337c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_rwlock_readercv;
4347c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_rwlock_writercv;
4357c478bd9Sstevel@tonic-gate } pthread_rwlock_t;
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate /*
4387c478bd9Sstevel@tonic-gate  * SUSV3
4397c478bd9Sstevel@tonic-gate  */
4407c478bd9Sstevel@tonic-gate typedef struct {
4417c478bd9Sstevel@tonic-gate 	uint32_t	__pthread_barrier_count;
4427c478bd9Sstevel@tonic-gate 	uint32_t	__pthread_barrier_current;
4437c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_barrier_cycle;
4447c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_barrier_reserved;
4457c478bd9Sstevel@tonic-gate 	pthread_mutex_t	__pthread_barrier_lock;
4467c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_barrier_cond;
4477c478bd9Sstevel@tonic-gate } pthread_barrier_t;
4487c478bd9Sstevel@tonic-gate 
4497c478bd9Sstevel@tonic-gate typedef	pthread_mutex_t	pthread_spinlock_t;
4507c478bd9Sstevel@tonic-gate 
4517c478bd9Sstevel@tonic-gate /*
4527c478bd9Sstevel@tonic-gate  * attributes for threads, dynamically allocated by library
4537c478bd9Sstevel@tonic-gate  */
4547c478bd9Sstevel@tonic-gate typedef struct _pthread_attr {
4557c478bd9Sstevel@tonic-gate 	void	*__pthread_attrp;
4567c478bd9Sstevel@tonic-gate } pthread_attr_t;
4577c478bd9Sstevel@tonic-gate 
4587c478bd9Sstevel@tonic-gate /*
4597c478bd9Sstevel@tonic-gate  * attributes for mutex, dynamically allocated by library
4607c478bd9Sstevel@tonic-gate  */
4617c478bd9Sstevel@tonic-gate typedef struct _pthread_mutexattr {
4627c478bd9Sstevel@tonic-gate 	void	*__pthread_mutexattrp;
4637c478bd9Sstevel@tonic-gate } pthread_mutexattr_t;
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate /*
4667c478bd9Sstevel@tonic-gate  * attributes for cond, dynamically allocated by library
4677c478bd9Sstevel@tonic-gate  */
4687c478bd9Sstevel@tonic-gate typedef struct _pthread_condattr {
4697c478bd9Sstevel@tonic-gate 	void	*__pthread_condattrp;
4707c478bd9Sstevel@tonic-gate } pthread_condattr_t;
4717c478bd9Sstevel@tonic-gate 
4727c478bd9Sstevel@tonic-gate /*
4737c478bd9Sstevel@tonic-gate  * pthread_once
4747c478bd9Sstevel@tonic-gate  */
4757c478bd9Sstevel@tonic-gate typedef	struct _once {
4767c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_once_pad[4];
4777c478bd9Sstevel@tonic-gate } pthread_once_t;
4787c478bd9Sstevel@tonic-gate 
4797c478bd9Sstevel@tonic-gate /*
4807c478bd9Sstevel@tonic-gate  * UNIX 98 Extensions
4817c478bd9Sstevel@tonic-gate  * attributes for rwlock, dynamically allocated by library
4827c478bd9Sstevel@tonic-gate  */
4837c478bd9Sstevel@tonic-gate typedef struct _pthread_rwlockattr {
4847c478bd9Sstevel@tonic-gate 	void	*__pthread_rwlockattrp;
4857c478bd9Sstevel@tonic-gate } pthread_rwlockattr_t;
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate /*
4887c478bd9Sstevel@tonic-gate  * SUSV3
4897c478bd9Sstevel@tonic-gate  * attributes for pthread_barrier_t, dynamically allocated by library
4907c478bd9Sstevel@tonic-gate  */
4917c478bd9Sstevel@tonic-gate typedef struct {
4927c478bd9Sstevel@tonic-gate 	void	*__pthread_barrierattrp;
4937c478bd9Sstevel@tonic-gate } pthread_barrierattr_t;
4947c478bd9Sstevel@tonic-gate 
4957c478bd9Sstevel@tonic-gate typedef ulong_t	dev_t;			/* expanded device type */
4967c478bd9Sstevel@tonic-gate 
4977c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
4987c478bd9Sstevel@tonic-gate typedef	uint_t nlink_t;			/* file link type	*/
4997c478bd9Sstevel@tonic-gate typedef int	pid_t;			/* process id type	*/
5007c478bd9Sstevel@tonic-gate #else
5017c478bd9Sstevel@tonic-gate typedef	ulong_t	nlink_t;		/* (historical version) */
5027c478bd9Sstevel@tonic-gate typedef	long	pid_t;			/* (historical version) */
5037c478bd9Sstevel@tonic-gate #endif
5047c478bd9Sstevel@tonic-gate 
5057c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
5067c478bd9Sstevel@tonic-gate #define	_SIZE_T
5077c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
5087c478bd9Sstevel@tonic-gate typedef	ulong_t	size_t;		/* size of something in bytes */
5097c478bd9Sstevel@tonic-gate #else
5107c478bd9Sstevel@tonic-gate typedef	uint_t	size_t;		/* (historical version) */
5117c478bd9Sstevel@tonic-gate #endif
5127c478bd9Sstevel@tonic-gate #endif	/* _SIZE_T */
5137c478bd9Sstevel@tonic-gate 
5147c478bd9Sstevel@tonic-gate #ifndef _SSIZE_T
5157c478bd9Sstevel@tonic-gate #define	_SSIZE_T
5167c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
5177c478bd9Sstevel@tonic-gate typedef long	ssize_t;	/* size of something in bytes or -1 */
5187c478bd9Sstevel@tonic-gate #else
5197c478bd9Sstevel@tonic-gate typedef int	ssize_t;	/* (historical version) */
5207c478bd9Sstevel@tonic-gate #endif
5217c478bd9Sstevel@tonic-gate #endif	/* _SSIZE_T */
5227c478bd9Sstevel@tonic-gate 
5237c478bd9Sstevel@tonic-gate #if !defined(_TIME_T) || __cplusplus >= 199711L
5247c478bd9Sstevel@tonic-gate #define	_TIME_T
5257c478bd9Sstevel@tonic-gate typedef	long		time_t;	/* time of day in seconds */
5267c478bd9Sstevel@tonic-gate #endif	/* _TIME_T */
5277c478bd9Sstevel@tonic-gate 
5287c478bd9Sstevel@tonic-gate #if !defined(_CLOCK_T) || __cplusplus >= 199711L
5297c478bd9Sstevel@tonic-gate #define	_CLOCK_T
5307c478bd9Sstevel@tonic-gate typedef	long		clock_t; /* relative time in a specified resolution */
5317c478bd9Sstevel@tonic-gate #endif	/* ifndef _CLOCK_T */
5327c478bd9Sstevel@tonic-gate 
5337c478bd9Sstevel@tonic-gate #ifndef _CLOCKID_T
5347c478bd9Sstevel@tonic-gate #define	_CLOCKID_T
5357c478bd9Sstevel@tonic-gate typedef	int	clockid_t;	/* clock identifier type */
5367c478bd9Sstevel@tonic-gate #endif	/* ifndef _CLOCKID_T */
5377c478bd9Sstevel@tonic-gate 
5387c478bd9Sstevel@tonic-gate #ifndef _TIMER_T
5397c478bd9Sstevel@tonic-gate #define	_TIMER_T
5407c478bd9Sstevel@tonic-gate typedef	int	timer_t;	/* timer identifier type */
5417c478bd9Sstevel@tonic-gate #endif	/* ifndef _TIMER_T */
5427c478bd9Sstevel@tonic-gate 
5437c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
5447c478bd9Sstevel@tonic-gate 
5457c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
5467c478bd9Sstevel@tonic-gate typedef	unsigned char	unchar;
5477c478bd9Sstevel@tonic-gate typedef	unsigned short	ushort;
5487c478bd9Sstevel@tonic-gate typedef	unsigned int	uint;
5497c478bd9Sstevel@tonic-gate typedef	unsigned long	ulong;
5507c478bd9Sstevel@tonic-gate /* END CSTYLED */
5517c478bd9Sstevel@tonic-gate 
5527c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
5537c478bd9Sstevel@tonic-gate 
5547c478bd9Sstevel@tonic-gate #define	SHRT_MIN	(-32768)	/* min value of a "short int" */
5557c478bd9Sstevel@tonic-gate #define	SHRT_MAX	32767		/* max value of a "short int" */
5567c478bd9Sstevel@tonic-gate #define	USHRT_MAX	65535		/* max of "unsigned short int" */
5577c478bd9Sstevel@tonic-gate #define	INT_MIN		(-2147483647-1) /* min value of an "int" */
5587c478bd9Sstevel@tonic-gate #define	INT_MAX		2147483647	/* max value of an "int" */
5597c478bd9Sstevel@tonic-gate #define	UINT_MAX	4294967295U	/* max value of an "unsigned int" */
5607c478bd9Sstevel@tonic-gate #if defined(_LP64)
5617c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-9223372036854775807L-1L)
5627c478bd9Sstevel@tonic-gate 					/* min value of a "long int" */
5637c478bd9Sstevel@tonic-gate #define	LONG_MAX	9223372036854775807L
5647c478bd9Sstevel@tonic-gate 					/* max value of a "long int" */
5657c478bd9Sstevel@tonic-gate #define	ULONG_MAX	18446744073709551615UL
5667c478bd9Sstevel@tonic-gate 					/* max of "unsigned long int" */
5677c478bd9Sstevel@tonic-gate #else /* _ILP32 */
5687c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-2147483647L-1L)
5697c478bd9Sstevel@tonic-gate 					/* min value of a "long int" */
5707c478bd9Sstevel@tonic-gate #define	LONG_MAX	2147483647L	/* max value of a "long int" */
5717c478bd9Sstevel@tonic-gate #define	ULONG_MAX	4294967295UL	/* max of "unsigned long int" */
5727c478bd9Sstevel@tonic-gate #endif
5737c478bd9Sstevel@tonic-gate 
5747c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) */
5757c478bd9Sstevel@tonic-gate 
5767c478bd9Sstevel@tonic-gate #define	P_MYPID	((pid_t)0)
5777c478bd9Sstevel@tonic-gate 
5787c478bd9Sstevel@tonic-gate /*
5797c478bd9Sstevel@tonic-gate  * The following is the value of type id_t to use to indicate the
5807c478bd9Sstevel@tonic-gate  * caller's current id.  See procset.h for the type idtype_t
5817c478bd9Sstevel@tonic-gate  * which defines which kind of id is being specified.
5827c478bd9Sstevel@tonic-gate  */
5837c478bd9Sstevel@tonic-gate #define	P_MYID	(-1)
5847c478bd9Sstevel@tonic-gate #define	NOPID (pid_t)(-1)
5857c478bd9Sstevel@tonic-gate 
5867c478bd9Sstevel@tonic-gate #ifndef NODEV
5877c478bd9Sstevel@tonic-gate #define	NODEV	(dev_t)(-1l)
5887c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
5897c478bd9Sstevel@tonic-gate #define	NODEV32	(dev32_t)(-1)
5907c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
5917c478bd9Sstevel@tonic-gate #endif	/* NODEV */
5927c478bd9Sstevel@tonic-gate 
5937c478bd9Sstevel@tonic-gate /*
5947c478bd9Sstevel@tonic-gate  * The following value of type pfn_t is used to indicate
5957c478bd9Sstevel@tonic-gate  * invalid page frame number.
5967c478bd9Sstevel@tonic-gate  */
5977c478bd9Sstevel@tonic-gate #define	PFN_INVALID	((pfn_t)-1)
5987c478bd9Sstevel@tonic-gate #define	PFN_SUSPENDED	((pfn_t)-2)
5997c478bd9Sstevel@tonic-gate 
6007c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
6017c478bd9Sstevel@tonic-gate typedef unsigned char	u_char;
6027c478bd9Sstevel@tonic-gate typedef unsigned short	u_short;
6037c478bd9Sstevel@tonic-gate typedef unsigned int	u_int;
6047c478bd9Sstevel@tonic-gate typedef unsigned long	u_long;
6057c478bd9Sstevel@tonic-gate typedef struct _quad { int val[2]; } quad_t;	/* used by UFS */
6067c478bd9Sstevel@tonic-gate typedef quad_t		quad;			/* used by UFS */
6077c478bd9Sstevel@tonic-gate /* END CSTYLED */
6087c478bd9Sstevel@tonic-gate 
6097c478bd9Sstevel@tonic-gate /*
6107c478bd9Sstevel@tonic-gate  * Nested include for BSD/sockets source compatibility.
6117c478bd9Sstevel@tonic-gate  * (The select macros used to be defined here).
6127c478bd9Sstevel@tonic-gate  */
6137c478bd9Sstevel@tonic-gate #include <sys/select.h>
6147c478bd9Sstevel@tonic-gate 
6157c478bd9Sstevel@tonic-gate #endif	/* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
6167c478bd9Sstevel@tonic-gate 
6177c478bd9Sstevel@tonic-gate /*
6187c478bd9Sstevel@tonic-gate  * _VOID was defined to be either void or char but this is not
6197c478bd9Sstevel@tonic-gate  * required because previous SunOS compilers have accepted the void
6207c478bd9Sstevel@tonic-gate  * type. However, because many system header and source files use the
6217c478bd9Sstevel@tonic-gate  * void keyword, the volatile keyword, and ANSI C function prototypes,
6227c478bd9Sstevel@tonic-gate  * non-ANSI compilers cannot compile the system anyway. The _VOID macro
6237c478bd9Sstevel@tonic-gate  * should therefore not be used and remains for source compatibility
6247c478bd9Sstevel@tonic-gate  * only.
6257c478bd9Sstevel@tonic-gate  */
6267c478bd9Sstevel@tonic-gate /* CSTYLED */
6277c478bd9Sstevel@tonic-gate #define	_VOID	void
6287c478bd9Sstevel@tonic-gate 
6297c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
6307c478bd9Sstevel@tonic-gate }
6317c478bd9Sstevel@tonic-gate #endif
6327c478bd9Sstevel@tonic-gate 
6337c478bd9Sstevel@tonic-gate #endif	/* _SYS_TYPES_H */
634