1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate /* 28*7c478bd9Sstevel@tonic-gate * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T 29*7c478bd9Sstevel@tonic-gate * All Rights Reserved 30*7c478bd9Sstevel@tonic-gate */ 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate /* 33*7c478bd9Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 34*7c478bd9Sstevel@tonic-gate * The Regents of the University of California 35*7c478bd9Sstevel@tonic-gate * All Rights Reserved 36*7c478bd9Sstevel@tonic-gate * 37*7c478bd9Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 38*7c478bd9Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 39*7c478bd9Sstevel@tonic-gate * contributors. 40*7c478bd9Sstevel@tonic-gate */ 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate #ifndef _SYS_TYPES_H 43*7c478bd9Sstevel@tonic-gate #define _SYS_TYPES_H 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate /* 48*7c478bd9Sstevel@tonic-gate * Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C 49*7c478bd9Sstevel@tonic-gate * committee's working draft for the revision of the current ISO C standard, 50*7c478bd9Sstevel@tonic-gate * ISO/IEC 9899:1990 Programming language - C. These are not currently 51*7c478bd9Sstevel@tonic-gate * required by any standard but constitute a useful, general purpose set 52*7c478bd9Sstevel@tonic-gate * of type definitions which is namespace clean with respect to all standards. 53*7c478bd9Sstevel@tonic-gate */ 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate #include <sys/int_types.h> 56*7c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h> 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 59*7c478bd9Sstevel@tonic-gate extern "C" { 60*7c478bd9Sstevel@tonic-gate #endif 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate #ifndef _ASM 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate /* From SunOS types.h */ 65*7c478bd9Sstevel@tonic-gate #if defined(mc68000) 66*7c478bd9Sstevel@tonic-gate typedef struct _physadr { short r[1]; } *physadr; 67*7c478bd9Sstevel@tonic-gate typedef struct _label { int val[13]; } label_t; 68*7c478bd9Sstevel@tonic-gate #elif defined(__i386) 69*7c478bd9Sstevel@tonic-gate typedef struct _physadr { short r[1]; } *physadr; 70*7c478bd9Sstevel@tonic-gate typedef struct _label { int val[8]; } label_t; 71*7c478bd9Sstevel@tonic-gate #elif defined(__sparc) 72*7c478bd9Sstevel@tonic-gate typedef struct _physadr { int r[1]; } *physadr; 73*7c478bd9Sstevel@tonic-gate typedef struct _label { int val[2]; } label_t; 74*7c478bd9Sstevel@tonic-gate #else 75*7c478bd9Sstevel@tonic-gate typedef struct _physadr { int r[1]; } *physadr; 76*7c478bd9Sstevel@tonic-gate typedef struct _label { int val[10]; } label_t; 77*7c478bd9Sstevel@tonic-gate #endif 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate /* POSIX Extensions */ 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gate typedef unsigned char uchar_t; 82*7c478bd9Sstevel@tonic-gate typedef unsigned short ushort_t; 83*7c478bd9Sstevel@tonic-gate typedef unsigned int uint_t; 84*7c478bd9Sstevel@tonic-gate typedef unsigned long ulong_t; 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate /* For BSD compatibility */ 88*7c478bd9Sstevel@tonic-gate typedef char *addr_t; /* ?<core address> type */ 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate typedef char *caddr_t; /* ?<core address> type */ 91*7c478bd9Sstevel@tonic-gate typedef long daddr_t; /* <disk address> type */ 92*7c478bd9Sstevel@tonic-gate typedef short cnt_t; /* ?<count> type */ 93*7c478bd9Sstevel@tonic-gate typedef ulong_t pgcnt_t; /* number of pages */ 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate #ifdef _ILP32 96*7c478bd9Sstevel@tonic-gate typedef ulong_t paddr_t; /* <physical address> type */ 97*7c478bd9Sstevel@tonic-gate typedef long swblk_t; 98*7c478bd9Sstevel@tonic-gate #endif 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate typedef uchar_t use_t; /* use count for swap. */ 101*7c478bd9Sstevel@tonic-gate typedef short sysid_t; 102*7c478bd9Sstevel@tonic-gate typedef short index_t; 103*7c478bd9Sstevel@tonic-gate typedef short lock_t; /* lock work for busy wait */ 104*7c478bd9Sstevel@tonic-gate typedef enum boolean { B_FALSE, B_TRUE } boolean_t; 105*7c478bd9Sstevel@tonic-gate typedef ulong_t l_dev_t; 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate /* 108*7c478bd9Sstevel@tonic-gate * The following protects users who use other than Sun compilers 109*7c478bd9Sstevel@tonic-gate * (eg, GNU C) that don't support long long, and need to include 110*7c478bd9Sstevel@tonic-gate * this header file. 111*7c478bd9Sstevel@tonic-gate */ 112*7c478bd9Sstevel@tonic-gate #ifdef _LONGLONG_TYPE 113*7c478bd9Sstevel@tonic-gate typedef long long longlong_t; 114*7c478bd9Sstevel@tonic-gate typedef unsigned long long u_longlong_t; 115*7c478bd9Sstevel@tonic-gate #else 116*7c478bd9Sstevel@tonic-gate #ifdef GCC 117*7c478bd9Sstevel@tonic-gate typedef int64_t longlong_t; 118*7c478bd9Sstevel@tonic-gate typedef uint64_t u_longlong_t; 119*7c478bd9Sstevel@tonic-gate #else 120*7c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */ 121*7c478bd9Sstevel@tonic-gate typedef union { 122*7c478bd9Sstevel@tonic-gate int32_t l[2]; 123*7c478bd9Sstevel@tonic-gate double d; 124*7c478bd9Sstevel@tonic-gate } longlong_t; 125*7c478bd9Sstevel@tonic-gate typedef union { 126*7c478bd9Sstevel@tonic-gate uint32_t l[2]; 127*7c478bd9Sstevel@tonic-gate double d; 128*7c478bd9Sstevel@tonic-gate } u_longlong_t; 129*7c478bd9Sstevel@tonic-gate #endif /* GCC */ 130*7c478bd9Sstevel@tonic-gate #endif /* _LONGLONG_TYPE */ 131*7c478bd9Sstevel@tonic-gate 132*7c478bd9Sstevel@tonic-gate /* 133*7c478bd9Sstevel@tonic-gate * The {u,}pad64_t types can be used in structures such that those structures 134*7c478bd9Sstevel@tonic-gate * may be accessed by code produced by compilation environments which don't 135*7c478bd9Sstevel@tonic-gate * support a 64 bit integral datatype. The intention is not to allow 136*7c478bd9Sstevel@tonic-gate * use of these fields in such environments, but to maintain the alignment 137*7c478bd9Sstevel@tonic-gate * and offsets of the structure. 138*7c478bd9Sstevel@tonic-gate * 139*7c478bd9Sstevel@tonic-gate * Similar comments for {u,}pad128_t. 140*7c478bd9Sstevel@tonic-gate * 141*7c478bd9Sstevel@tonic-gate * Note that these types do NOT generate any stronger alignment constraints 142*7c478bd9Sstevel@tonic-gate * than those available in the underlying ABI. See <sys/isa_list.h> 143*7c478bd9Sstevel@tonic-gate */ 144*7c478bd9Sstevel@tonic-gate #ifdef _LONGLONG_TYPE 145*7c478bd9Sstevel@tonic-gate typedef int64_t pad64_t; 146*7c478bd9Sstevel@tonic-gate typedef uint64_t upad64_t; 147*7c478bd9Sstevel@tonic-gate #else 148*7c478bd9Sstevel@tonic-gate typedef union { 149*7c478bd9Sstevel@tonic-gate double _d; 150*7c478bd9Sstevel@tonic-gate int32_t _l[2]; 151*7c478bd9Sstevel@tonic-gate } pad64_t; 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate typedef union { 154*7c478bd9Sstevel@tonic-gate double _d; 155*7c478bd9Sstevel@tonic-gate uint32_t _l[2]; 156*7c478bd9Sstevel@tonic-gate } upad64_t; 157*7c478bd9Sstevel@tonic-gate #endif /* _LONGLONG_TYPE */ 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate typedef union { 160*7c478bd9Sstevel@tonic-gate long double _q; 161*7c478bd9Sstevel@tonic-gate int32_t _l[4]; 162*7c478bd9Sstevel@tonic-gate } pad128_t; 163*7c478bd9Sstevel@tonic-gate 164*7c478bd9Sstevel@tonic-gate typedef union { 165*7c478bd9Sstevel@tonic-gate long double _q; 166*7c478bd9Sstevel@tonic-gate uint32_t _l[4]; 167*7c478bd9Sstevel@tonic-gate } upad128_t; 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gate /* 170*7c478bd9Sstevel@tonic-gate * attributes for threads, dynamically allocated by library 171*7c478bd9Sstevel@tonic-gate */ 172*7c478bd9Sstevel@tonic-gate typedef struct { 173*7c478bd9Sstevel@tonic-gate void *__pthread_attrp; 174*7c478bd9Sstevel@tonic-gate } pthread_attr_t; 175*7c478bd9Sstevel@tonic-gate 176*7c478bd9Sstevel@tonic-gate /* types related to file sizes, counts, offsets, etc. */ 177*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32 178*7c478bd9Sstevel@tonic-gate typedef long off_t; /* ?<offset> type */ 179*7c478bd9Sstevel@tonic-gate typedef long blkcnt_t; /* counts file blocks */ 180*7c478bd9Sstevel@tonic-gate typedef ulong_t fsblkcnt_t; /* counts file system blocks */ 181*7c478bd9Sstevel@tonic-gate typedef ulong_t fsfilcnt_t; /* counts files */ 182*7c478bd9Sstevel@tonic-gate typedef ulong_t ino_t; /* expanded inode type */ 183*7c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64 184*7c478bd9Sstevel@tonic-gate typedef longlong_t off_t; /* offsets within files */ 185*7c478bd9Sstevel@tonic-gate typedef longlong_t blkcnt_t; /* count of file blocks */ 186*7c478bd9Sstevel@tonic-gate typedef u_longlong_t fsblkcnt_t; /* count of file system blocks */ 187*7c478bd9Sstevel@tonic-gate typedef u_longlong_t fsfilcnt_t; /* count of files */ 188*7c478bd9Sstevel@tonic-gate typedef u_longlong_t ino_t; /* expanded inode type */ 189*7c478bd9Sstevel@tonic-gate #endif 190*7c478bd9Sstevel@tonic-gate 191*7c478bd9Sstevel@tonic-gate #ifdef _LP64 192*7c478bd9Sstevel@tonic-gate typedef int blksize_t; /* used for block sizes */ 193*7c478bd9Sstevel@tonic-gate #else 194*7c478bd9Sstevel@tonic-gate typedef long blksize_t; /* used for block sizes */ 195*7c478bd9Sstevel@tonic-gate #endif 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gate #ifdef _LARGEFILE64_SOURCE 198*7c478bd9Sstevel@tonic-gate #ifdef _LP64 199*7c478bd9Sstevel@tonic-gate typedef off_t off64_t; 200*7c478bd9Sstevel@tonic-gate typedef blkcnt_t blkcnt64_t; 201*7c478bd9Sstevel@tonic-gate typedef fsblkcnt_t fsblkcnt64_t; 202*7c478bd9Sstevel@tonic-gate typedef fsfilcnt_t fsfilcnt64_t; 203*7c478bd9Sstevel@tonic-gate typedef ino_t ino64_t; 204*7c478bd9Sstevel@tonic-gate #else 205*7c478bd9Sstevel@tonic-gate typedef longlong_t off64_t; /* ?<offset> type */ 206*7c478bd9Sstevel@tonic-gate typedef longlong_t blkcnt64_t; /* counts file blocks */ 207*7c478bd9Sstevel@tonic-gate typedef u_longlong_t fsblkcnt64_t; /* counts file system blocks */ 208*7c478bd9Sstevel@tonic-gate typedef u_longlong_t fsfilcnt64_t; /* counts files */ 209*7c478bd9Sstevel@tonic-gate typedef u_longlong_t ino64_t; /* expanded inode type */ 210*7c478bd9Sstevel@tonic-gate #endif 211*7c478bd9Sstevel@tonic-gate #endif 212*7c478bd9Sstevel@tonic-gate 213*7c478bd9Sstevel@tonic-gate /* 214*7c478bd9Sstevel@tonic-gate * The following type is for various kinds of identifiers. The 215*7c478bd9Sstevel@tonic-gate * actual type must be the same for all since some system calls 216*7c478bd9Sstevel@tonic-gate * (such as sigsend) take arguments that may be any of these 217*7c478bd9Sstevel@tonic-gate * types. The enumeration type idtype_t defined in sys/procset.h 218*7c478bd9Sstevel@tonic-gate * is used to indicate what type of id is being specified. 219*7c478bd9Sstevel@tonic-gate */ 220*7c478bd9Sstevel@tonic-gate 221*7c478bd9Sstevel@tonic-gate typedef longlong_t offset_t; 222*7c478bd9Sstevel@tonic-gate typedef u_longlong_t u_offset_t; 223*7c478bd9Sstevel@tonic-gate typedef longlong_t diskaddr_t; 224*7c478bd9Sstevel@tonic-gate 225*7c478bd9Sstevel@tonic-gate /* 226*7c478bd9Sstevel@tonic-gate * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had 227*7c478bd9Sstevel@tonic-gate * to use them instead of int32_t and uint32_t because DEC had 228*7c478bd9Sstevel@tonic-gate * shipped 64-bit wide. 229*7c478bd9Sstevel@tonic-gate */ 230*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx) 231*7c478bd9Sstevel@tonic-gate typedef int32_t t_scalar_t; 232*7c478bd9Sstevel@tonic-gate typedef uint32_t t_uscalar_t; 233*7c478bd9Sstevel@tonic-gate #else 234*7c478bd9Sstevel@tonic-gate typedef long t_scalar_t; /* historical versions */ 235*7c478bd9Sstevel@tonic-gate typedef unsigned long t_uscalar_t; 236*7c478bd9Sstevel@tonic-gate #endif /* defined(_LP64) || defined(_I32LPx) */ 237*7c478bd9Sstevel@tonic-gate 238*7c478bd9Sstevel@tonic-gate /* 239*7c478bd9Sstevel@tonic-gate * Partial support for 64-bit file offset enclosed herein, 240*7c478bd9Sstevel@tonic-gate * specifically used to access devices greater than 2gb. 241*7c478bd9Sstevel@tonic-gate * However, support for devices greater than 2gb requires compiler 242*7c478bd9Sstevel@tonic-gate * support for long long. 243*7c478bd9Sstevel@tonic-gate */ 244*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH 245*7c478bd9Sstevel@tonic-gate typedef union lloff { 246*7c478bd9Sstevel@tonic-gate offset_t _f; /* Full 64 bit offset value */ 247*7c478bd9Sstevel@tonic-gate struct { 248*7c478bd9Sstevel@tonic-gate int32_t _l; /* lower 32 bits of offset value */ 249*7c478bd9Sstevel@tonic-gate int32_t _u; /* upper 32 bits of offset value */ 250*7c478bd9Sstevel@tonic-gate } _p; 251*7c478bd9Sstevel@tonic-gate } lloff_t; 252*7c478bd9Sstevel@tonic-gate #endif 253*7c478bd9Sstevel@tonic-gate 254*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL 255*7c478bd9Sstevel@tonic-gate typedef union lloff { 256*7c478bd9Sstevel@tonic-gate offset_t _f; /* Full 64 bit offset value */ 257*7c478bd9Sstevel@tonic-gate struct { 258*7c478bd9Sstevel@tonic-gate int32_t _u; /* upper 32 bits of offset value */ 259*7c478bd9Sstevel@tonic-gate int32_t _l; /* lower 32 bits of offset value */ 260*7c478bd9Sstevel@tonic-gate } _p; 261*7c478bd9Sstevel@tonic-gate } lloff_t; 262*7c478bd9Sstevel@tonic-gate #endif 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH 265*7c478bd9Sstevel@tonic-gate typedef union lldaddr { 266*7c478bd9Sstevel@tonic-gate diskaddr_t _f; /* Full 64 bit disk address value */ 267*7c478bd9Sstevel@tonic-gate struct { 268*7c478bd9Sstevel@tonic-gate int32_t _l; /* lower 32 bits of disk address value */ 269*7c478bd9Sstevel@tonic-gate int32_t _u; /* upper 32 bits of disk address value */ 270*7c478bd9Sstevel@tonic-gate } _p; 271*7c478bd9Sstevel@tonic-gate } lldaddr_t; 272*7c478bd9Sstevel@tonic-gate #endif 273*7c478bd9Sstevel@tonic-gate 274*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL 275*7c478bd9Sstevel@tonic-gate typedef union lldaddr { 276*7c478bd9Sstevel@tonic-gate diskaddr_t _f; /* Full 64 bit disk address value */ 277*7c478bd9Sstevel@tonic-gate struct { 278*7c478bd9Sstevel@tonic-gate int32_t _u; /* upper 32 bits of disk address value */ 279*7c478bd9Sstevel@tonic-gate int32_t _l; /* lower 32 bits of disk address value */ 280*7c478bd9Sstevel@tonic-gate } _p; 281*7c478bd9Sstevel@tonic-gate } lldaddr_t; 282*7c478bd9Sstevel@tonic-gate #endif 283*7c478bd9Sstevel@tonic-gate 284*7c478bd9Sstevel@tonic-gate typedef ulong_t k_fltset_t; /* kernel fault set type */ 285*7c478bd9Sstevel@tonic-gate 286*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx) 287*7c478bd9Sstevel@tonic-gate typedef int id_t; /* A process id, */ 288*7c478bd9Sstevel@tonic-gate /* process group id, */ 289*7c478bd9Sstevel@tonic-gate /* session id, */ 290*7c478bd9Sstevel@tonic-gate /* scheduling class id, */ 291*7c478bd9Sstevel@tonic-gate /* user id or group id. */ 292*7c478bd9Sstevel@tonic-gate #else 293*7c478bd9Sstevel@tonic-gate typedef long id_t; 294*7c478bd9Sstevel@tonic-gate #endif 295*7c478bd9Sstevel@tonic-gate 296*7c478bd9Sstevel@tonic-gate typedef void *timeout_id_t; 297*7c478bd9Sstevel@tonic-gate typedef void *bufcall_id_t; 298*7c478bd9Sstevel@tonic-gate 299*7c478bd9Sstevel@tonic-gate /* Typedefs for dev_t components */ 300*7c478bd9Sstevel@tonic-gate 301*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 302*7c478bd9Sstevel@tonic-gate typedef ulong_t major_t; /* major part of device number */ 303*7c478bd9Sstevel@tonic-gate typedef ulong_t minor_t; /* minor part of device number */ 304*7c478bd9Sstevel@tonic-gate #else 305*7c478bd9Sstevel@tonic-gate typedef uint_t major_t; 306*7c478bd9Sstevel@tonic-gate typedef uint_t minor_t; 307*7c478bd9Sstevel@tonic-gate #endif 308*7c478bd9Sstevel@tonic-gate 309*7c478bd9Sstevel@tonic-gate typedef short pri_t; 310*7c478bd9Sstevel@tonic-gate 311*7c478bd9Sstevel@tonic-gate /* 312*7c478bd9Sstevel@tonic-gate * For compatibility reasons the following typedefs (prefixed o_) 313*7c478bd9Sstevel@tonic-gate * can't grow regardless of the EFT definition. Although, 314*7c478bd9Sstevel@tonic-gate * applications should not explicitly use these typedefs 315*7c478bd9Sstevel@tonic-gate * they may be included via a system header definition. 316*7c478bd9Sstevel@tonic-gate * WARNING: These typedefs may be removed in a future 317*7c478bd9Sstevel@tonic-gate * release. 318*7c478bd9Sstevel@tonic-gate * ex. the definitions in s5inode.h (now obsoleted) 319*7c478bd9Sstevel@tonic-gate * remained small to preserve compatibility 320*7c478bd9Sstevel@tonic-gate * in the S5 file system type. 321*7c478bd9Sstevel@tonic-gate */ 322*7c478bd9Sstevel@tonic-gate typedef ushort_t o_mode_t; /* old file attribute type */ 323*7c478bd9Sstevel@tonic-gate typedef short o_dev_t; /* old device type */ 324*7c478bd9Sstevel@tonic-gate typedef ushort_t o_uid_t; /* old UID type */ 325*7c478bd9Sstevel@tonic-gate typedef o_uid_t o_gid_t; /* old GID type */ 326*7c478bd9Sstevel@tonic-gate typedef short o_nlink_t; /* old file link type */ 327*7c478bd9Sstevel@tonic-gate typedef short o_pid_t; /* old process id type */ 328*7c478bd9Sstevel@tonic-gate typedef ushort_t o_ino_t; /* old inode type */ 329*7c478bd9Sstevel@tonic-gate 330*7c478bd9Sstevel@tonic-gate /* POSIX and XOPEN Declarations */ 331*7c478bd9Sstevel@tonic-gate 332*7c478bd9Sstevel@tonic-gate typedef int key_t; /* IPC key type */ 333*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 334*7c478bd9Sstevel@tonic-gate typedef ulong_t mode_t; /* file attribute type */ 335*7c478bd9Sstevel@tonic-gate #else 336*7c478bd9Sstevel@tonic-gate typedef uint_t mode_t; 337*7c478bd9Sstevel@tonic-gate #endif 338*7c478bd9Sstevel@tonic-gate 339*7c478bd9Sstevel@tonic-gate #ifndef _UID_T 340*7c478bd9Sstevel@tonic-gate #define _UID_T 341*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 342*7c478bd9Sstevel@tonic-gate typedef long uid_t; /* UID type */ 343*7c478bd9Sstevel@tonic-gate #else 344*7c478bd9Sstevel@tonic-gate typedef int uid_t; 345*7c478bd9Sstevel@tonic-gate #endif 346*7c478bd9Sstevel@tonic-gate #endif 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate typedef uid_t gid_t; /* GID type */ 349*7c478bd9Sstevel@tonic-gate typedef id_t taskid_t; /* task ID type */ 350*7c478bd9Sstevel@tonic-gate typedef id_t projid_t; /* project ID type */ 351*7c478bd9Sstevel@tonic-gate typedef id_t poolid_t; /* pool ID type */ 352*7c478bd9Sstevel@tonic-gate typedef id_t zoneid_t; /* zone ID type */ 353*7c478bd9Sstevel@tonic-gate typedef id_t ctid_t; /* contract ID type */ 354*7c478bd9Sstevel@tonic-gate 355*7c478bd9Sstevel@tonic-gate typedef ulong_t dev_t; /* expanded device type */ 356*7c478bd9Sstevel@tonic-gate 357*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 358*7c478bd9Sstevel@tonic-gate typedef ulong_t nlink_t; /* file link type */ 359*7c478bd9Sstevel@tonic-gate typedef long pid_t; /* process id type */ 360*7c478bd9Sstevel@tonic-gate #else 361*7c478bd9Sstevel@tonic-gate typedef uint_t nlink_t; 362*7c478bd9Sstevel@tonic-gate typedef int pid_t; 363*7c478bd9Sstevel@tonic-gate #endif 364*7c478bd9Sstevel@tonic-gate 365*7c478bd9Sstevel@tonic-gate #ifndef _SIZE_T 366*7c478bd9Sstevel@tonic-gate #define _SIZE_T 367*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 368*7c478bd9Sstevel@tonic-gate typedef uint_t size_t; 369*7c478bd9Sstevel@tonic-gate #else 370*7c478bd9Sstevel@tonic-gate typedef ulong_t size_t; 371*7c478bd9Sstevel@tonic-gate #endif 372*7c478bd9Sstevel@tonic-gate #endif 373*7c478bd9Sstevel@tonic-gate 374*7c478bd9Sstevel@tonic-gate #ifndef _SSIZE_T 375*7c478bd9Sstevel@tonic-gate #define _SSIZE_T 376*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && defined(__cplusplus) 377*7c478bd9Sstevel@tonic-gate typedef int ssize_t; 378*7c478bd9Sstevel@tonic-gate #else 379*7c478bd9Sstevel@tonic-gate typedef long ssize_t; /* used by functions which return a */ 380*7c478bd9Sstevel@tonic-gate /* count of bytes or an error indication */ 381*7c478bd9Sstevel@tonic-gate #endif 382*7c478bd9Sstevel@tonic-gate #endif 383*7c478bd9Sstevel@tonic-gate 384*7c478bd9Sstevel@tonic-gate #ifndef _TIME_T 385*7c478bd9Sstevel@tonic-gate #define _TIME_T 386*7c478bd9Sstevel@tonic-gate typedef long time_t; /* time of day in seconds */ 387*7c478bd9Sstevel@tonic-gate #endif /* _TIME_T */ 388*7c478bd9Sstevel@tonic-gate 389*7c478bd9Sstevel@tonic-gate #ifndef _CLOCK_T 390*7c478bd9Sstevel@tonic-gate #define _CLOCK_T 391*7c478bd9Sstevel@tonic-gate typedef long clock_t; /* relative time in a specified resolution */ 392*7c478bd9Sstevel@tonic-gate #endif /* ifndef _CLOCK_T */ 393*7c478bd9Sstevel@tonic-gate 394*7c478bd9Sstevel@tonic-gate #if (defined(_KERNEL) || !defined(_POSIX_SOURCE)) 395*7c478bd9Sstevel@tonic-gate 396*7c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */ 397*7c478bd9Sstevel@tonic-gate typedef unsigned char unchar; 398*7c478bd9Sstevel@tonic-gate typedef unsigned int uint; 399*7c478bd9Sstevel@tonic-gate typedef unsigned long ulong; 400*7c478bd9Sstevel@tonic-gate /* END CSTYLED */ 401*7c478bd9Sstevel@tonic-gate 402*7c478bd9Sstevel@tonic-gate #if defined(_KERNEL) 403*7c478bd9Sstevel@tonic-gate 404*7c478bd9Sstevel@tonic-gate #define SHRT_MIN -32768 /* min value of a "short int" */ 405*7c478bd9Sstevel@tonic-gate #define SHRT_MAX 32767 /* max value of a "short int" */ 406*7c478bd9Sstevel@tonic-gate #define USHRT_MAX 65535u /* max value of "unsigned short int" */ 407*7c478bd9Sstevel@tonic-gate #define INT_MIN (-2147483647-1) /* min value of an "int" */ 408*7c478bd9Sstevel@tonic-gate #define INT_MAX 2147483647 /* max value of an "int" */ 409*7c478bd9Sstevel@tonic-gate #define UINT_MAX 4294967295u /* max value of an "unsigned int" */ 410*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) 411*7c478bd9Sstevel@tonic-gate #define LONG_MIN (-2147483647L-1L) /* min value of a "long int" */ 412*7c478bd9Sstevel@tonic-gate #define LONG_MAX 2147483647L /* max value of a "long int" */ 413*7c478bd9Sstevel@tonic-gate #define ULONG_MAX 4294967295UL /* max value of "unsigned long int" */ 414*7c478bd9Sstevel@tonic-gate #else 415*7c478bd9Sstevel@tonic-gate #define LONG_MIN (-9223372036854775807L-1L) 416*7c478bd9Sstevel@tonic-gate #define LONG_MAX 9223372036854775807L 417*7c478bd9Sstevel@tonic-gate #define ULONG_MAX 18446744073709551615UL 418*7c478bd9Sstevel@tonic-gate #endif 419*7c478bd9Sstevel@tonic-gate 420*7c478bd9Sstevel@tonic-gate #endif /* defined(_KERNEL) */ 421*7c478bd9Sstevel@tonic-gate 422*7c478bd9Sstevel@tonic-gate 423*7c478bd9Sstevel@tonic-gate #define P_MYPID ((pid_t)0) 424*7c478bd9Sstevel@tonic-gate 425*7c478bd9Sstevel@tonic-gate /* 426*7c478bd9Sstevel@tonic-gate * The following is the value of type id_t to use to indicate the 427*7c478bd9Sstevel@tonic-gate * caller's current id. See procset.h for the type idtype_t 428*7c478bd9Sstevel@tonic-gate * which defines which kind of id is being specified. 429*7c478bd9Sstevel@tonic-gate */ 430*7c478bd9Sstevel@tonic-gate 431*7c478bd9Sstevel@tonic-gate #define P_MYID (-1) 432*7c478bd9Sstevel@tonic-gate #define NOPID (pid_t)(-1) 433*7c478bd9Sstevel@tonic-gate 434*7c478bd9Sstevel@tonic-gate #ifndef NODEV 435*7c478bd9Sstevel@tonic-gate #define NODEV (dev_t)(-1) 436*7c478bd9Sstevel@tonic-gate #endif 437*7c478bd9Sstevel@tonic-gate 438*7c478bd9Sstevel@tonic-gate #ifdef _ILP32 439*7c478bd9Sstevel@tonic-gate /* 440*7c478bd9Sstevel@tonic-gate * A host identifier is used to uniquely define a particular node 441*7c478bd9Sstevel@tonic-gate * on an rfs network. Its type is as follows. 442*7c478bd9Sstevel@tonic-gate */ 443*7c478bd9Sstevel@tonic-gate 444*7c478bd9Sstevel@tonic-gate typedef long hostid_t; 445*7c478bd9Sstevel@tonic-gate 446*7c478bd9Sstevel@tonic-gate /* 447*7c478bd9Sstevel@tonic-gate * The following value of type hostid_t is used to indicate the 448*7c478bd9Sstevel@tonic-gate * current host. The actual hostid for each host is in the 449*7c478bd9Sstevel@tonic-gate * kernel global variable rfs_hostid. 450*7c478bd9Sstevel@tonic-gate */ 451*7c478bd9Sstevel@tonic-gate 452*7c478bd9Sstevel@tonic-gate #define P_MYHOSTID (-1) 453*7c478bd9Sstevel@tonic-gate #endif 454*7c478bd9Sstevel@tonic-gate 455*7c478bd9Sstevel@tonic-gate #endif /* END (defined(_KERNEL) || !defined(_POSIX_SOURCE)) */ 456*7c478bd9Sstevel@tonic-gate 457*7c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */ 458*7c478bd9Sstevel@tonic-gate typedef unsigned char u_char; 459*7c478bd9Sstevel@tonic-gate typedef unsigned short u_short; 460*7c478bd9Sstevel@tonic-gate typedef unsigned int u_int; 461*7c478bd9Sstevel@tonic-gate typedef unsigned long u_long; 462*7c478bd9Sstevel@tonic-gate typedef unsigned short ushort; /* sys III compat */ 463*7c478bd9Sstevel@tonic-gate typedef struct _quad { int val[2]; } quad; /* used by UFS */ 464*7c478bd9Sstevel@tonic-gate /* END CSTYLED */ 465*7c478bd9Sstevel@tonic-gate 466*7c478bd9Sstevel@tonic-gate /* 467*7c478bd9Sstevel@tonic-gate * These were added to allow non-ANSI compilers to compile the system. 468*7c478bd9Sstevel@tonic-gate */ 469*7c478bd9Sstevel@tonic-gate 470*7c478bd9Sstevel@tonic-gate #ifdef __STDC__ 471*7c478bd9Sstevel@tonic-gate 472*7c478bd9Sstevel@tonic-gate /* _VOID, const, volatile left in for source compatibility */ 473*7c478bd9Sstevel@tonic-gate 474*7c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */ 475*7c478bd9Sstevel@tonic-gate #ifndef _VOID 476*7c478bd9Sstevel@tonic-gate #define _VOID void 477*7c478bd9Sstevel@tonic-gate #endif 478*7c478bd9Sstevel@tonic-gate 479*7c478bd9Sstevel@tonic-gate #else 480*7c478bd9Sstevel@tonic-gate 481*7c478bd9Sstevel@tonic-gate #ifndef _VOID 482*7c478bd9Sstevel@tonic-gate #define _VOID char 483*7c478bd9Sstevel@tonic-gate #endif 484*7c478bd9Sstevel@tonic-gate 485*7c478bd9Sstevel@tonic-gate #ifndef const 486*7c478bd9Sstevel@tonic-gate #define const 487*7c478bd9Sstevel@tonic-gate #endif 488*7c478bd9Sstevel@tonic-gate 489*7c478bd9Sstevel@tonic-gate #ifndef volatile 490*7c478bd9Sstevel@tonic-gate #define volatile 491*7c478bd9Sstevel@tonic-gate #endif 492*7c478bd9Sstevel@tonic-gate /* END CSTYLED */ 493*7c478bd9Sstevel@tonic-gate 494*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 495*7c478bd9Sstevel@tonic-gate 496*7c478bd9Sstevel@tonic-gate #endif /* _ASM */ 497*7c478bd9Sstevel@tonic-gate 498*7c478bd9Sstevel@tonic-gate /* 499*7c478bd9Sstevel@tonic-gate * Nested include for BSD/sockets source compatibility. 500*7c478bd9Sstevel@tonic-gate * (The select macros used to be defined here). 501*7c478bd9Sstevel@tonic-gate */ 502*7c478bd9Sstevel@tonic-gate #include <sys/select.h> 503*7c478bd9Sstevel@tonic-gate /* 504*7c478bd9Sstevel@tonic-gate * Nested include for BSD compatibility. 505*7c478bd9Sstevel@tonic-gate */ 506*7c478bd9Sstevel@tonic-gate 507*7c478bd9Sstevel@tonic-gate #define AHZ 64 508*7c478bd9Sstevel@tonic-gate 509*7c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h> 510*7c478bd9Sstevel@tonic-gate 511*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 512*7c478bd9Sstevel@tonic-gate } 513*7c478bd9Sstevel@tonic-gate #endif 514*7c478bd9Sstevel@tonic-gate 515*7c478bd9Sstevel@tonic-gate #endif /* _SYS_TYPES_H */ 516