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