xref: /illumos-gate/usr/src/ucbhead/sys/types.h (revision 2b24ab6b)
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
5*2b24ab6bSSebastien Roy  * Common Development and Distribution License (the "License").
6*2b24ab6bSSebastien Roy  * 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 /*
22*2b24ab6bSSebastien Roy  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  *	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
287c478bd9Sstevel@tonic-gate  *	  All Rights Reserved
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate /*
327c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
337c478bd9Sstevel@tonic-gate  * The Regents of the University of California
347c478bd9Sstevel@tonic-gate  * All Rights Reserved
357c478bd9Sstevel@tonic-gate  *
367c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
377c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
387c478bd9Sstevel@tonic-gate  * contributors.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #ifndef	_SYS_TYPES_H
427c478bd9Sstevel@tonic-gate #define	_SYS_TYPES_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 
527c478bd9Sstevel@tonic-gate #include <sys/int_types.h>
537c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #ifdef __cplusplus
567c478bd9Sstevel@tonic-gate extern "C" {
577c478bd9Sstevel@tonic-gate #endif
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate #ifndef _ASM
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /* From SunOS types.h */
627c478bd9Sstevel@tonic-gate #if defined(mc68000)
637c478bd9Sstevel@tonic-gate typedef	struct _physadr { short r[1]; } *physadr;
647c478bd9Sstevel@tonic-gate typedef	struct _label { int val[13]; } label_t;
657c478bd9Sstevel@tonic-gate #elif defined(__i386)
667c478bd9Sstevel@tonic-gate typedef	struct _physadr { short r[1]; } *physadr;
677c478bd9Sstevel@tonic-gate typedef	struct _label { int val[8]; } label_t;
687c478bd9Sstevel@tonic-gate #elif defined(__sparc)
697c478bd9Sstevel@tonic-gate typedef	struct _physadr { int r[1]; } *physadr;
707c478bd9Sstevel@tonic-gate typedef	struct _label { int val[2]; } label_t;
717c478bd9Sstevel@tonic-gate #else
727c478bd9Sstevel@tonic-gate typedef	struct _physadr { int r[1]; } *physadr;
737c478bd9Sstevel@tonic-gate typedef	struct _label { int val[10]; } label_t;
747c478bd9Sstevel@tonic-gate #endif
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate /* POSIX Extensions */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate typedef unsigned char   uchar_t;
797c478bd9Sstevel@tonic-gate typedef unsigned short  ushort_t;
807c478bd9Sstevel@tonic-gate typedef unsigned int    uint_t;
817c478bd9Sstevel@tonic-gate typedef unsigned long   ulong_t;
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /* For BSD compatibility */
857c478bd9Sstevel@tonic-gate typedef char 		*addr_t;	/* ?<core address> type */
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate typedef char 		*caddr_t;	/* ?<core address> type */
887c478bd9Sstevel@tonic-gate typedef long		daddr_t;	/* <disk address> type */
897c478bd9Sstevel@tonic-gate typedef short		cnt_t;		/* ?<count> type */
907c478bd9Sstevel@tonic-gate typedef ulong_t		pgcnt_t;	/* number of pages */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #ifdef _ILP32
937c478bd9Sstevel@tonic-gate typedef ulong_t 	paddr_t;	/* <physical address> type */
947c478bd9Sstevel@tonic-gate typedef	long		swblk_t;
957c478bd9Sstevel@tonic-gate #endif
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate typedef uchar_t 	use_t;		/* use count for swap.  */
987c478bd9Sstevel@tonic-gate typedef short		sysid_t;
997c478bd9Sstevel@tonic-gate typedef short		index_t;
1007c478bd9Sstevel@tonic-gate typedef short		lock_t;		/* lock work for busy wait */
1017c478bd9Sstevel@tonic-gate typedef enum boolean { B_FALSE, B_TRUE } boolean_t;
1027c478bd9Sstevel@tonic-gate typedef ulong_t		l_dev_t;
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate /*
1057c478bd9Sstevel@tonic-gate  * The following protects users who use other than Sun compilers
1067c478bd9Sstevel@tonic-gate  * (eg, GNU C) that don't support long long, and need to include
1077c478bd9Sstevel@tonic-gate  * this header file.
1087c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate #ifdef _LONGLONG_TYPE
1107c478bd9Sstevel@tonic-gate typedef	long long		longlong_t;
1117c478bd9Sstevel@tonic-gate typedef	unsigned long long	u_longlong_t;
1127c478bd9Sstevel@tonic-gate #else
1137c478bd9Sstevel@tonic-gate #ifdef GCC
1147c478bd9Sstevel@tonic-gate typedef int64_t longlong_t;
1157c478bd9Sstevel@tonic-gate typedef uint64_t u_longlong_t;
1167c478bd9Sstevel@tonic-gate #else
1177c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */
1187c478bd9Sstevel@tonic-gate typedef	union {
1197c478bd9Sstevel@tonic-gate 	int32_t	l[2];
1207c478bd9Sstevel@tonic-gate 	double	d;
1217c478bd9Sstevel@tonic-gate } longlong_t;
1227c478bd9Sstevel@tonic-gate typedef	union {
1237c478bd9Sstevel@tonic-gate 	uint32_t	l[2];
1247c478bd9Sstevel@tonic-gate 	double		d;
1257c478bd9Sstevel@tonic-gate } u_longlong_t;
1267c478bd9Sstevel@tonic-gate #endif	/* GCC */
1277c478bd9Sstevel@tonic-gate #endif	/* _LONGLONG_TYPE */
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate /*
1307c478bd9Sstevel@tonic-gate  * The {u,}pad64_t types can be used in structures such that those structures
1317c478bd9Sstevel@tonic-gate  * may be accessed by code produced by compilation environments which don't
1327c478bd9Sstevel@tonic-gate  * support a 64 bit integral datatype.  The intention is not to allow
1337c478bd9Sstevel@tonic-gate  * use of these fields in such environments, but to maintain the alignment
1347c478bd9Sstevel@tonic-gate  * and offsets of the structure.
1357c478bd9Sstevel@tonic-gate  *
1367c478bd9Sstevel@tonic-gate  * Similar comments for {u,}pad128_t.
1377c478bd9Sstevel@tonic-gate  *
1387c478bd9Sstevel@tonic-gate  * Note that these types do NOT generate any stronger alignment constraints
1397c478bd9Sstevel@tonic-gate  * than those available in the underlying ABI.  See <sys/isa_list.h>
1407c478bd9Sstevel@tonic-gate  */
1417c478bd9Sstevel@tonic-gate #ifdef _LONGLONG_TYPE
1427c478bd9Sstevel@tonic-gate typedef int64_t		pad64_t;
1437c478bd9Sstevel@tonic-gate typedef	uint64_t	upad64_t;
1447c478bd9Sstevel@tonic-gate #else
1457c478bd9Sstevel@tonic-gate typedef union {
1467c478bd9Sstevel@tonic-gate 	double   _d;
1477c478bd9Sstevel@tonic-gate 	int32_t  _l[2];
1487c478bd9Sstevel@tonic-gate } pad64_t;
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate typedef union {
1517c478bd9Sstevel@tonic-gate 	double   _d;
1527c478bd9Sstevel@tonic-gate 	uint32_t _l[2];
1537c478bd9Sstevel@tonic-gate } upad64_t;
1547c478bd9Sstevel@tonic-gate #endif /* _LONGLONG_TYPE */
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate typedef union {
1577c478bd9Sstevel@tonic-gate 	long double	_q;
1587c478bd9Sstevel@tonic-gate 	int32_t		_l[4];
1597c478bd9Sstevel@tonic-gate } pad128_t;
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate typedef union {
1627c478bd9Sstevel@tonic-gate 	long double	_q;
1637c478bd9Sstevel@tonic-gate 	uint32_t	_l[4];
1647c478bd9Sstevel@tonic-gate } upad128_t;
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /*
1677c478bd9Sstevel@tonic-gate  * attributes for threads, dynamically allocated by library
1687c478bd9Sstevel@tonic-gate  */
1697c478bd9Sstevel@tonic-gate typedef	struct {
1707c478bd9Sstevel@tonic-gate 	void	*__pthread_attrp;
1717c478bd9Sstevel@tonic-gate } pthread_attr_t;
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /* types related to file sizes, counts, offsets, etc. */
1747c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
1757c478bd9Sstevel@tonic-gate typedef long		off_t;		/* ?<offset> type */
1767c478bd9Sstevel@tonic-gate typedef long		blkcnt_t;	/* counts file blocks */
1777c478bd9Sstevel@tonic-gate typedef ulong_t		fsblkcnt_t;	/* counts file system blocks */
1787c478bd9Sstevel@tonic-gate typedef ulong_t		fsfilcnt_t;	/* counts files */
1797c478bd9Sstevel@tonic-gate typedef ulong_t		ino_t;		/* expanded inode type	*/
1807c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64
1817c478bd9Sstevel@tonic-gate typedef longlong_t	off_t;		/* offsets within files */
1827c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt_t;	/* count of file blocks */
1837c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt_t;	/* count of file system blocks */
1847c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt_t;	/* count of files */
1857c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino_t;		/* expanded inode type */
1867c478bd9Sstevel@tonic-gate #endif
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate #ifdef _LP64
1897c478bd9Sstevel@tonic-gate typedef	int		blksize_t;	/* used for block sizes */
1907c478bd9Sstevel@tonic-gate #else
1917c478bd9Sstevel@tonic-gate typedef	long		blksize_t;	/* used for block sizes */
1927c478bd9Sstevel@tonic-gate #endif
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate #ifdef _LARGEFILE64_SOURCE
1957c478bd9Sstevel@tonic-gate #ifdef _LP64
1967c478bd9Sstevel@tonic-gate typedef off_t		off64_t;
1977c478bd9Sstevel@tonic-gate typedef blkcnt_t	blkcnt64_t;
1987c478bd9Sstevel@tonic-gate typedef fsblkcnt_t	fsblkcnt64_t;
1997c478bd9Sstevel@tonic-gate typedef fsfilcnt_t	fsfilcnt64_t;
2007c478bd9Sstevel@tonic-gate typedef ino_t		ino64_t;
2017c478bd9Sstevel@tonic-gate #else
2027c478bd9Sstevel@tonic-gate typedef longlong_t	off64_t;	/* ?<offset> type */
2037c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt64_t;	/* counts file blocks */
2047c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt64_t;	/* counts file system blocks */
2057c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt64_t;	/* counts files */
2067c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino64_t;	/* expanded inode type	*/
2077c478bd9Sstevel@tonic-gate #endif
2087c478bd9Sstevel@tonic-gate #endif
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate /*
2117c478bd9Sstevel@tonic-gate  * The following type is for various kinds of identifiers.  The
2127c478bd9Sstevel@tonic-gate  * actual type must be the same for all since some system calls
2137c478bd9Sstevel@tonic-gate  * (such as sigsend) take arguments that may be any of these
2147c478bd9Sstevel@tonic-gate  * types.  The enumeration type idtype_t defined in sys/procset.h
2157c478bd9Sstevel@tonic-gate  * is used to indicate what type of id is being specified.
2167c478bd9Sstevel@tonic-gate  */
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate typedef	longlong_t	offset_t;
2197c478bd9Sstevel@tonic-gate typedef	u_longlong_t	u_offset_t;
2207c478bd9Sstevel@tonic-gate typedef	longlong_t	diskaddr_t;
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate /*
2237c478bd9Sstevel@tonic-gate  * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had
2247c478bd9Sstevel@tonic-gate  * to use them instead of int32_t and uint32_t because DEC had
2257c478bd9Sstevel@tonic-gate  * shipped 64-bit wide.
2267c478bd9Sstevel@tonic-gate  */
2277c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
2287c478bd9Sstevel@tonic-gate typedef int32_t		t_scalar_t;
2297c478bd9Sstevel@tonic-gate typedef uint32_t	t_uscalar_t;
2307c478bd9Sstevel@tonic-gate #else
2317c478bd9Sstevel@tonic-gate typedef long		t_scalar_t;	/* historical versions */
2327c478bd9Sstevel@tonic-gate typedef unsigned long	t_uscalar_t;
2337c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_I32LPx) */
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /*
2367c478bd9Sstevel@tonic-gate  * Partial support for 64-bit file offset enclosed herein,
2377c478bd9Sstevel@tonic-gate  * specifically used to access devices greater than 2gb.
2387c478bd9Sstevel@tonic-gate  * However, support for devices greater than 2gb requires compiler
2397c478bd9Sstevel@tonic-gate  * support for long long.
2407c478bd9Sstevel@tonic-gate  */
2417c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
2427c478bd9Sstevel@tonic-gate typedef union lloff {
2437c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
2447c478bd9Sstevel@tonic-gate 	struct {
2457c478bd9Sstevel@tonic-gate 		int32_t _l;	/* lower 32 bits of offset value */
2467c478bd9Sstevel@tonic-gate 		int32_t _u;	/* upper 32 bits of offset value */
2477c478bd9Sstevel@tonic-gate 	} _p;
2487c478bd9Sstevel@tonic-gate } lloff_t;
2497c478bd9Sstevel@tonic-gate #endif
2507c478bd9Sstevel@tonic-gate 
2517c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
2527c478bd9Sstevel@tonic-gate typedef union lloff {
2537c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
2547c478bd9Sstevel@tonic-gate 	struct {
2557c478bd9Sstevel@tonic-gate 		int32_t _u;	/* upper 32 bits of offset value */
2567c478bd9Sstevel@tonic-gate 		int32_t _l;	/* lower 32 bits of offset value */
2577c478bd9Sstevel@tonic-gate 	} _p;
2587c478bd9Sstevel@tonic-gate } lloff_t;
2597c478bd9Sstevel@tonic-gate #endif
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
2627c478bd9Sstevel@tonic-gate typedef union lldaddr {
2637c478bd9Sstevel@tonic-gate 	diskaddr_t	_f;	/* Full 64 bit disk address value */
2647c478bd9Sstevel@tonic-gate 	struct {
2657c478bd9Sstevel@tonic-gate 		int32_t _l;	/* lower 32 bits of disk address value */
2667c478bd9Sstevel@tonic-gate 		int32_t _u;	/* upper 32 bits of disk address value */
2677c478bd9Sstevel@tonic-gate 	} _p;
2687c478bd9Sstevel@tonic-gate } lldaddr_t;
2697c478bd9Sstevel@tonic-gate #endif
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
2727c478bd9Sstevel@tonic-gate typedef union lldaddr {
2737c478bd9Sstevel@tonic-gate 	diskaddr_t	_f;	/* Full 64 bit disk address value */
2747c478bd9Sstevel@tonic-gate 	struct {
2757c478bd9Sstevel@tonic-gate 		int32_t _u;	/* upper 32 bits of disk address value */
2767c478bd9Sstevel@tonic-gate 		int32_t _l;	/* lower 32 bits of disk address value */
2777c478bd9Sstevel@tonic-gate 	} _p;
2787c478bd9Sstevel@tonic-gate } lldaddr_t;
2797c478bd9Sstevel@tonic-gate #endif
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate typedef ulong_t k_fltset_t;	/* kernel fault set type */
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
2847c478bd9Sstevel@tonic-gate typedef int		id_t;		/* A process id,	*/
2857c478bd9Sstevel@tonic-gate 					/* process group id,	*/
2867c478bd9Sstevel@tonic-gate 					/* session id,		*/
2877c478bd9Sstevel@tonic-gate 					/* scheduling class id, */
2887c478bd9Sstevel@tonic-gate 					/* user id or group id. */
2897c478bd9Sstevel@tonic-gate #else
2907c478bd9Sstevel@tonic-gate typedef long		id_t;
2917c478bd9Sstevel@tonic-gate #endif
2927c478bd9Sstevel@tonic-gate 
2937c478bd9Sstevel@tonic-gate typedef void	*timeout_id_t;
2947c478bd9Sstevel@tonic-gate typedef void	*bufcall_id_t;
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate /* Typedefs for dev_t components */
2977c478bd9Sstevel@tonic-gate 
2987c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
2997c478bd9Sstevel@tonic-gate typedef ulong_t major_t;	/* major part of device number */
3007c478bd9Sstevel@tonic-gate typedef ulong_t minor_t;	/* minor part of device number */
3017c478bd9Sstevel@tonic-gate #else
3027c478bd9Sstevel@tonic-gate typedef uint_t major_t;
3037c478bd9Sstevel@tonic-gate typedef uint_t minor_t;
3047c478bd9Sstevel@tonic-gate #endif
3057c478bd9Sstevel@tonic-gate 
3067c478bd9Sstevel@tonic-gate typedef short	pri_t;
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate /*
3097c478bd9Sstevel@tonic-gate  * For compatibility reasons the following typedefs (prefixed o_)
3107c478bd9Sstevel@tonic-gate  * can't grow regardless of the EFT definition. Although,
3117c478bd9Sstevel@tonic-gate  * applications should not explicitly use these typedefs
3127c478bd9Sstevel@tonic-gate  * they may be included via a system header definition.
3137c478bd9Sstevel@tonic-gate  * WARNING: These typedefs may be removed in a future
3147c478bd9Sstevel@tonic-gate  * release.
3157c478bd9Sstevel@tonic-gate  *		ex. the definitions in s5inode.h (now obsoleted)
3167c478bd9Sstevel@tonic-gate  *			remained small to preserve compatibility
3177c478bd9Sstevel@tonic-gate  *			in the S5 file system type.
3187c478bd9Sstevel@tonic-gate  */
3197c478bd9Sstevel@tonic-gate typedef ushort_t o_mode_t;		/* old file attribute type */
3207c478bd9Sstevel@tonic-gate typedef short	o_dev_t;		/* old device type	*/
3217c478bd9Sstevel@tonic-gate typedef ushort_t o_uid_t;		/* old UID type		*/
3227c478bd9Sstevel@tonic-gate typedef o_uid_t	o_gid_t;		/* old GID type		*/
3237c478bd9Sstevel@tonic-gate typedef short	o_nlink_t;		/* old file link type	*/
3247c478bd9Sstevel@tonic-gate typedef short	o_pid_t;		/* old process id type	*/
3257c478bd9Sstevel@tonic-gate typedef ushort_t o_ino_t;		/* old inode type	*/
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate /* POSIX and XOPEN Declarations */
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate typedef int	key_t;			/* IPC key type */
3307c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
3317c478bd9Sstevel@tonic-gate typedef ulong_t	mode_t;			/* file attribute type  */
3327c478bd9Sstevel@tonic-gate #else
3337c478bd9Sstevel@tonic-gate typedef uint_t	mode_t;
3347c478bd9Sstevel@tonic-gate #endif
3357c478bd9Sstevel@tonic-gate 
3367c478bd9Sstevel@tonic-gate #ifndef	_UID_T
3377c478bd9Sstevel@tonic-gate #define	_UID_T
3387c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
3397c478bd9Sstevel@tonic-gate typedef long	uid_t;			/* UID type		*/
3407c478bd9Sstevel@tonic-gate #else
3417c478bd9Sstevel@tonic-gate typedef int	uid_t;
3427c478bd9Sstevel@tonic-gate #endif
3437c478bd9Sstevel@tonic-gate #endif
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate typedef uid_t	gid_t;			/* GID type		*/
3467c478bd9Sstevel@tonic-gate typedef id_t	taskid_t;		/* task ID type		*/
3477c478bd9Sstevel@tonic-gate typedef id_t	projid_t;		/* project ID type	*/
3487c478bd9Sstevel@tonic-gate typedef	id_t	poolid_t;		/* pool ID type		*/
3497c478bd9Sstevel@tonic-gate typedef id_t	zoneid_t;		/* zone ID type		*/
3507c478bd9Sstevel@tonic-gate typedef id_t	ctid_t;			/* contract ID type	*/
3517c478bd9Sstevel@tonic-gate 
352*2b24ab6bSSebastien Roy typedef uint32_t datalink_id_t;
353*2b24ab6bSSebastien Roy 
3547c478bd9Sstevel@tonic-gate typedef ulong_t	dev_t;			/* expanded device type	*/
3557c478bd9Sstevel@tonic-gate 
3567c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
3577c478bd9Sstevel@tonic-gate typedef ulong_t	nlink_t;		/* file link type	*/
3587c478bd9Sstevel@tonic-gate typedef long	pid_t;			/* process id type	*/
3597c478bd9Sstevel@tonic-gate #else
3607c478bd9Sstevel@tonic-gate typedef uint_t	nlink_t;
3617c478bd9Sstevel@tonic-gate typedef int	pid_t;
3627c478bd9Sstevel@tonic-gate #endif
3637c478bd9Sstevel@tonic-gate 
3647c478bd9Sstevel@tonic-gate #ifndef	_SIZE_T
3657c478bd9Sstevel@tonic-gate #define	_SIZE_T
3667c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
3677c478bd9Sstevel@tonic-gate typedef uint_t	size_t;
3687c478bd9Sstevel@tonic-gate #else
3697c478bd9Sstevel@tonic-gate typedef ulong_t	size_t;
3707c478bd9Sstevel@tonic-gate #endif
3717c478bd9Sstevel@tonic-gate #endif
3727c478bd9Sstevel@tonic-gate 
3737c478bd9Sstevel@tonic-gate #ifndef	_SSIZE_T
3747c478bd9Sstevel@tonic-gate #define	_SSIZE_T
3757c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus)
3767c478bd9Sstevel@tonic-gate typedef int	ssize_t;
3777c478bd9Sstevel@tonic-gate #else
3787c478bd9Sstevel@tonic-gate typedef long	ssize_t;	/* used by functions which return a */
3797c478bd9Sstevel@tonic-gate 				/* count of bytes or an error indication */
3807c478bd9Sstevel@tonic-gate #endif
3817c478bd9Sstevel@tonic-gate #endif
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate #ifndef	_TIME_T
3847c478bd9Sstevel@tonic-gate #define	_TIME_T
3857c478bd9Sstevel@tonic-gate typedef long	time_t;		/* time of day in seconds */
3867c478bd9Sstevel@tonic-gate #endif  /* _TIME_T */
3877c478bd9Sstevel@tonic-gate 
3887c478bd9Sstevel@tonic-gate #ifndef	_CLOCK_T
3897c478bd9Sstevel@tonic-gate #define	_CLOCK_T
3907c478bd9Sstevel@tonic-gate typedef long		clock_t; /* relative time in a specified resolution */
3917c478bd9Sstevel@tonic-gate #endif	/* ifndef _CLOCK_T */
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate #if (defined(_KERNEL) || !defined(_POSIX_SOURCE))
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
3967c478bd9Sstevel@tonic-gate typedef unsigned char   unchar;
3977c478bd9Sstevel@tonic-gate typedef unsigned int    uint;
3987c478bd9Sstevel@tonic-gate typedef unsigned long   ulong;
3997c478bd9Sstevel@tonic-gate /* END CSTYLED */
4007c478bd9Sstevel@tonic-gate 
4017c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
4027c478bd9Sstevel@tonic-gate 
4037c478bd9Sstevel@tonic-gate #define	SHRT_MIN	-32768		/* min value of a "short int" */
4047c478bd9Sstevel@tonic-gate #define	SHRT_MAX	32767		/* max value of a "short int" */
4057c478bd9Sstevel@tonic-gate #define	USHRT_MAX	65535u		/* max value of "unsigned short int" */
4067c478bd9Sstevel@tonic-gate #define	INT_MIN		(-2147483647-1)	/* min value of an "int" */
4077c478bd9Sstevel@tonic-gate #define	INT_MAX		2147483647	/* max value of an "int" */
4087c478bd9Sstevel@tonic-gate #define	UINT_MAX	4294967295u	/* max value of an "unsigned int" */
4097c478bd9Sstevel@tonic-gate #if !defined(_LP64)
4107c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-2147483647L-1L)	/* min value of a "long int" */
4117c478bd9Sstevel@tonic-gate #define	LONG_MAX	2147483647L	/* max value of a "long int" */
4127c478bd9Sstevel@tonic-gate #define	ULONG_MAX	4294967295UL	/* max value of "unsigned long int" */
4137c478bd9Sstevel@tonic-gate #else
4147c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-9223372036854775807L-1L)
4157c478bd9Sstevel@tonic-gate #define	LONG_MAX	9223372036854775807L
4167c478bd9Sstevel@tonic-gate #define	ULONG_MAX	18446744073709551615UL
4177c478bd9Sstevel@tonic-gate #endif
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) */
4207c478bd9Sstevel@tonic-gate 
4217c478bd9Sstevel@tonic-gate 
4227c478bd9Sstevel@tonic-gate #define	P_MYPID	((pid_t)0)
4237c478bd9Sstevel@tonic-gate 
4247c478bd9Sstevel@tonic-gate /*
4257c478bd9Sstevel@tonic-gate  * The following is the value of type id_t to use to indicate the
4267c478bd9Sstevel@tonic-gate  * caller's current id.  See procset.h for the type idtype_t
4277c478bd9Sstevel@tonic-gate  * which defines which kind of id is being specified.
4287c478bd9Sstevel@tonic-gate  */
4297c478bd9Sstevel@tonic-gate 
4307c478bd9Sstevel@tonic-gate #define	P_MYID	(-1)
4317c478bd9Sstevel@tonic-gate #define	NOPID (pid_t)(-1)
4327c478bd9Sstevel@tonic-gate 
4337c478bd9Sstevel@tonic-gate #ifndef	NODEV
4347c478bd9Sstevel@tonic-gate #define	NODEV (dev_t)(-1)
4357c478bd9Sstevel@tonic-gate #endif
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate #ifdef _ILP32
4387c478bd9Sstevel@tonic-gate /*
4397c478bd9Sstevel@tonic-gate  * A host identifier is used to uniquely define a particular node
4407c478bd9Sstevel@tonic-gate  * on an rfs network.  Its type is as follows.
4417c478bd9Sstevel@tonic-gate  */
4427c478bd9Sstevel@tonic-gate 
4437c478bd9Sstevel@tonic-gate typedef	long	hostid_t;
4447c478bd9Sstevel@tonic-gate 
4457c478bd9Sstevel@tonic-gate /*
4467c478bd9Sstevel@tonic-gate  * The following value of type hostid_t is used to indicate the
4477c478bd9Sstevel@tonic-gate  * current host.  The actual hostid for each host is in the
4487c478bd9Sstevel@tonic-gate  * kernel global variable rfs_hostid.
4497c478bd9Sstevel@tonic-gate  */
4507c478bd9Sstevel@tonic-gate 
4517c478bd9Sstevel@tonic-gate #define	P_MYHOSTID	(-1)
4527c478bd9Sstevel@tonic-gate #endif
4537c478bd9Sstevel@tonic-gate 
4547c478bd9Sstevel@tonic-gate #endif /* END (defined(_KERNEL) || !defined(_POSIX_SOURCE)) */
4557c478bd9Sstevel@tonic-gate 
4567c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
4577c478bd9Sstevel@tonic-gate typedef unsigned char	u_char;
4587c478bd9Sstevel@tonic-gate typedef unsigned short	u_short;
4597c478bd9Sstevel@tonic-gate typedef unsigned int	u_int;
4607c478bd9Sstevel@tonic-gate typedef unsigned long	u_long;
4617c478bd9Sstevel@tonic-gate typedef unsigned short	ushort;		/* sys III compat */
4627c478bd9Sstevel@tonic-gate typedef struct _quad { int val[2]; } quad;	/* used by UFS */
4637c478bd9Sstevel@tonic-gate /* END CSTYLED */
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate /*
4667c478bd9Sstevel@tonic-gate  * These were added to allow non-ANSI compilers to compile the system.
4677c478bd9Sstevel@tonic-gate  */
4687c478bd9Sstevel@tonic-gate 
4697c478bd9Sstevel@tonic-gate #ifdef	__STDC__
4707c478bd9Sstevel@tonic-gate 
4717c478bd9Sstevel@tonic-gate /* _VOID, const, volatile left in for source compatibility */
4727c478bd9Sstevel@tonic-gate 
4737c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
4747c478bd9Sstevel@tonic-gate #ifndef	_VOID
4757c478bd9Sstevel@tonic-gate #define	_VOID	void
4767c478bd9Sstevel@tonic-gate #endif
4777c478bd9Sstevel@tonic-gate 
4787c478bd9Sstevel@tonic-gate #else
4797c478bd9Sstevel@tonic-gate 
4807c478bd9Sstevel@tonic-gate #ifndef	_VOID
4817c478bd9Sstevel@tonic-gate #define	_VOID	char
4827c478bd9Sstevel@tonic-gate #endif
4837c478bd9Sstevel@tonic-gate 
4847c478bd9Sstevel@tonic-gate #ifndef	const
4857c478bd9Sstevel@tonic-gate #define	const
4867c478bd9Sstevel@tonic-gate #endif
4877c478bd9Sstevel@tonic-gate 
4887c478bd9Sstevel@tonic-gate #ifndef	volatile
4897c478bd9Sstevel@tonic-gate #define	volatile
4907c478bd9Sstevel@tonic-gate #endif
4917c478bd9Sstevel@tonic-gate /* END CSTYLED */
4927c478bd9Sstevel@tonic-gate 
4937c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
4947c478bd9Sstevel@tonic-gate 
4957c478bd9Sstevel@tonic-gate #endif /* _ASM */
4967c478bd9Sstevel@tonic-gate 
4977c478bd9Sstevel@tonic-gate /*
4987c478bd9Sstevel@tonic-gate  * Nested include for BSD/sockets source compatibility.
4997c478bd9Sstevel@tonic-gate  * (The select macros used to be defined here).
5007c478bd9Sstevel@tonic-gate  */
5017c478bd9Sstevel@tonic-gate #include <sys/select.h>
5027c478bd9Sstevel@tonic-gate /*
5037c478bd9Sstevel@tonic-gate  * Nested include for BSD compatibility.
5047c478bd9Sstevel@tonic-gate  */
5057c478bd9Sstevel@tonic-gate 
5067c478bd9Sstevel@tonic-gate #define	AHZ 64
5077c478bd9Sstevel@tonic-gate 
5087c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h>
5097c478bd9Sstevel@tonic-gate 
5107c478bd9Sstevel@tonic-gate #ifdef __cplusplus
5117c478bd9Sstevel@tonic-gate }
5127c478bd9Sstevel@tonic-gate #endif
5137c478bd9Sstevel@tonic-gate 
5147c478bd9Sstevel@tonic-gate #endif	/* _SYS_TYPES_H */
515