/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
* All Rights Reserved
*/
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
/*
* committee's working draft for the revision of the current ISO C standard,
* required by any standard but constitute a useful, general purpose set
* of type definitions which is namespace clean with respect to all standards.
*/
#include <sys/int_types.h>
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
/* From SunOS types.h */
#if defined(mc68000)
#else
#endif
/* POSIX Extensions */
typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef unsigned long ulong_t;
/* For BSD compatibility */
#ifdef _ILP32
typedef long swblk_t;
#endif
typedef short sysid_t;
typedef short index_t;
/*
* The following protects users who use other than Sun compilers
* (eg, GNU C) that don't support long long, and need to include
* this header file.
*/
#ifdef _LONGLONG_TYPE
typedef long long longlong_t;
typedef unsigned long long u_longlong_t;
#else
#ifdef GCC
#else
/* used to reserve space and generate alignment */
typedef union {
int32_t l[2];
double d;
} longlong_t;
typedef union {
uint32_t l[2];
double d;
} u_longlong_t;
#endif /* GCC */
#endif /* _LONGLONG_TYPE */
/*
* The {u,}pad64_t types can be used in structures such that those structures
* may be accessed by code produced by compilation environments which don't
* support a 64 bit integral datatype. The intention is not to allow
* use of these fields in such environments, but to maintain the alignment
* and offsets of the structure.
*
* Similar comments for {u,}pad128_t.
*
* Note that these types do NOT generate any stronger alignment constraints
* than those available in the underlying ABI. See <sys/isa_list.h>
*/
#ifdef _LONGLONG_TYPE
#else
typedef union {
double _d;
} pad64_t;
typedef union {
double _d;
} upad64_t;
#endif /* _LONGLONG_TYPE */
typedef union {
long double _q;
} pad128_t;
typedef union {
long double _q;
} upad128_t;
/*
* attributes for threads, dynamically allocated by library
*/
typedef struct {
void *__pthread_attrp;
/* types related to file sizes, counts, offsets, etc. */
#endif
#ifdef _LP64
#else
#endif
#ifdef _LARGEFILE64_SOURCE
#ifdef _LP64
#else
#endif
#endif
/*
* The following type is for various kinds of identifiers. The
* actual type must be the same for all since some system calls
* (such as sigsend) take arguments that may be any of these
* is used to indicate what type of id is being specified.
*/
/*
* to use them instead of int32_t and uint32_t because DEC had
* shipped 64-bit wide.
*/
#else
typedef unsigned long t_uscalar_t;
#endif /* defined(_LP64) || defined(_I32LPx) */
/*
* Partial support for 64-bit file offset enclosed herein,
* specifically used to access devices greater than 2gb.
* However, support for devices greater than 2gb requires compiler
* support for long long.
*/
#ifdef _LONG_LONG_LTOH
typedef union lloff {
struct {
} _p;
} lloff_t;
#endif
#ifdef _LONG_LONG_HTOL
typedef union lloff {
struct {
} _p;
} lloff_t;
#endif
#ifdef _LONG_LONG_LTOH
typedef union lldaddr {
struct {
} _p;
} lldaddr_t;
#endif
#ifdef _LONG_LONG_HTOL
typedef union lldaddr {
struct {
} _p;
} lldaddr_t;
#endif
/* process group id, */
/* session id, */
/* scheduling class id, */
/* user id or group id. */
#else
typedef long id_t;
#endif
typedef void *timeout_id_t;
typedef void *bufcall_id_t;
/* Typedefs for dev_t components */
#if !defined(_LP64) && defined(__cplusplus)
#else
#endif
typedef short pri_t;
/*
* For compatibility reasons the following typedefs (prefixed o_)
* can't grow regardless of the EFT definition. Although,
* applications should not explicitly use these typedefs
* they may be included via a system header definition.
* WARNING: These typedefs may be removed in a future
* release.
* ex. the definitions in s5inode.h (now obsoleted)
* remained small to preserve compatibility
* in the S5 file system type.
*/
/* POSIX and XOPEN Declarations */
#if !defined(_LP64) && defined(__cplusplus)
#else
#endif
#ifndef _UID_T
#define _UID_T
#if !defined(_LP64) && defined(__cplusplus)
#else
typedef int uid_t;
#endif
#endif
#if !defined(_LP64) && defined(__cplusplus)
#else
typedef int pid_t;
#endif
#ifndef _SIZE_T
#define _SIZE_T
#if !defined(_LP64) && defined(__cplusplus)
#else
#endif
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
#if !defined(_LP64) && defined(__cplusplus)
typedef int ssize_t;
#else
/* count of bytes or an error indication */
#endif
#endif
#ifndef _TIME_T
#define _TIME_T
#endif /* _TIME_T */
#ifndef _CLOCK_T
#define _CLOCK_T
#endif /* ifndef _CLOCK_T */
#if (defined(_KERNEL) || !defined(_POSIX_SOURCE))
/* BEGIN CSTYLED */
typedef unsigned char unchar;
typedef unsigned int uint;
typedef unsigned long ulong;
/* END CSTYLED */
#if defined(_KERNEL)
#if !defined(_LP64)
#else
#endif
#endif /* defined(_KERNEL) */
/*
* The following is the value of type id_t to use to indicate the
* caller's current id. See procset.h for the type idtype_t
* which defines which kind of id is being specified.
*/
#ifndef NODEV
#endif
#ifdef _ILP32
/*
* A host identifier is used to uniquely define a particular node
* on an rfs network. Its type is as follows.
*/
typedef long hostid_t;
/*
* The following value of type hostid_t is used to indicate the
* current host. The actual hostid for each host is in the
* kernel global variable rfs_hostid.
*/
#endif
#endif /* END (defined(_KERNEL) || !defined(_POSIX_SOURCE)) */
/* BEGIN CSTYLED */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
/* END CSTYLED */
/*
* These were added to allow non-ANSI compilers to compile the system.
*/
#ifdef __STDC__
/* _VOID, const, volatile left in for source compatibility */
/* BEGIN CSTYLED */
#ifndef _VOID
#define _VOID void
#endif
#else
#ifndef _VOID
#define _VOID char
#endif
#ifndef const
#define const
#endif
#ifndef volatile
#define volatile
#endif
/* END CSTYLED */
#endif /* __STDC__ */
#endif /* _ASM */
/*
* (The select macros used to be defined here).
*/
/*
* Nested include for BSD compatibility.
*/
#include <sys/sysmacros.h>
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TYPES_H */