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