/* @(#) types.h $Date: 2004/08/05 11:42:41 $Revision: i380/4 PATCH_11.23 (PHKL_31500) */ /* (C) Copyright 1996 - 2004 Hewlett-Packard Development Company, LP * This header provides definitions for basic data types. */ #ifndef _SYS_TYPES_INCLUDED #define _SYS_TYPES_INCLUDED #include #include /* * This check is not needed since the inclusion of this header * file indicates that the application expects something other * than strict ansi namespace. Removing it to fix problems in * other header files. * *#ifdef _INCLUDE_POSIX_SOURCE */ # ifndef _MQD_T # define _MQD_T typedef int mqd_t; /* POSIX MQ descriptor index */ # endif /* _MQD_T */ # ifndef _DEV_T # define _DEV_T typedef int32_t dev_t; /* For device numbers */ # endif /* _DEV_T */ # ifndef _INO32_T # define _INO32_T typedef uint32_t ino32_t; # endif /* _INO32_T */ # ifndef _INO64_T # define _INO64_T # if !defined(__STDC_32_MODE__) typedef uint64_t ino64_t; # endif # endif /* _INO32_T */ # ifndef _PSETID_T # define _PSETID_T typedef int psetid_t; /* processor set ID */ # endif /* _PSETID_T */ # ifndef _INO_T # define _INO_T typedef unsigned long ino_t; # endif /* _INO_T */ # ifndef _MODE_T # define _MODE_T typedef uint16_t mode_t; /* For file types and modes */ # endif /* _MODE_T */ # ifndef _NLINK_T # define _NLINK_T typedef uint16_t nlink_t; /* For link counts */ # endif /* _NLINK_T */ # ifndef _FPOS32_T # define _FPOS32_T typedef int32_t fpos32_t; /* 32bit position inside a file */ # endif /* _FPOS32_T */ # ifndef _FPOS64_T # define _FPOS64_T # if !defined(__STDC_32_MODE__) typedef int64_t fpos64_t; /* 64bit position inside a file */ # endif # endif /* _FPOS64_T */ _NAMESPACE_STD_START # ifndef _FPOS_T # define _FPOS_T # ifdef _APP32_64BIT_OFF_T typedef int64_t fpos_t; /* position inside a file */ # else typedef long fpos_t; # endif # endif /* _FPOS_T */ _NAMESPACE_STD_END # ifndef _FSBLOCKS32_T # define _FSBLOCKS32_T typedef uint32_t fsblkcnt32_t; /* blocks within a file system */ # endif /* _FSBLOCKS32_T */ # ifndef _FSBLOCKS64_T # define _FSBLOCKS64_T # if !defined(__STDC_32_MODE__) typedef uint64_t fsblkcnt64_t; /* blocks within a file system */ # endif # endif /* _FSBLOCKS64_T */ # ifndef _FSBLOCKS_T # define _FSBLOCKS_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) typedef uint64_t fsblkcnt_t; /* block count */ # define k_fsblkcnt_t fsblkcnt_t # else typedef unsigned long fsblkcnt_t; # endif # endif /* _FSBLOCKS_T */ # ifndef _OFF32_T # define _OFF32_T typedef int32_t off32_t; /* 32bit offsets and sizes */ # endif /* _OFF32_T */ #ifndef _BSIZE32_T # define _BSIZE32_T typedef int32_t sbsize32_t; typedef uint32_t bsize32_t; #endif /* _BSIZE32_T */ # ifndef _OFF64_T # define _OFF64_T # if !defined(__STDC_32_MODE__) typedef int64_t off64_t; /* 64bit offsets and sizes */ # endif # endif /* _OFF64_T */ # ifndef _BSIZE64_T # define _BSIZE64_T # if !defined(__STDC_32_MODE__) typedef int64_t sbsize64_t; typedef uint64_t bsize64_t; # endif # endif /* _BSIZE64_T */ # ifndef _OFF_T # define _OFF_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) typedef int64_t off_t; /* For offsets and sizes */ # define k_off_t off_t # else typedef long off_t; # endif # endif /* _OFF_T */ # ifndef _BSIZE_T # define _BSIZE_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) typedef int64_t sbsize_t; /* signed length in bytes */ typedef uint64_t bsize_t; /* unsigned length in bytes */ # else typedef long sbsize_t; typedef unsigned long bsize_t; # endif # endif /* _BSIZE_T */ # ifndef _FSFILCNT32_T # define _FSFILCNT32_T typedef uint32_t fsfilcnt32_t; /* free file nodes */ # endif /* _FSFILCNT32_T */ # ifndef _FSFILCNT64_T # define _FSFILCNT64_T # if !defined(__STDC_32_MODE__) typedef uint64_t fsfilcnt64_t; /* free file nodes */ # endif # endif /* _FSFILCNT64_T */ # ifndef _FSFILCNT_T # define _FSFILCNT_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) typedef uint64_t fsfilcnt_t; /* free file nodes */ # define k_fsfilcnt_t fsfilcnt_t # else typedef unsigned long fsfilcnt_t; # endif # endif /* _FSFILCNT_T */ # ifndef _BLKCNT32_T # define _BLKCNT32_T typedef int32_t blkcnt32_t; /* 32-bit # of blocks */ # endif /* _BLKCNT32_T */ # ifndef _BLKCNT64_T # define _BLKCNT64_T # if !defined(__STDC_32_MODE__) typedef int64_t blkcnt64_t; /* 64-bit # of blocks */ # endif # endif /* _BLKCNT64_T */ # ifndef _BLKCNT_T # define _BLKCNT_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) typedef int64_t blkcnt_t; /* # of blocks */ # define k_blkcnt_t blkcnt_t # else typedef long blkcnt_t; # endif # endif /* _BLKCNT_T */ # ifndef _PID_T # define _PID_T typedef int32_t pid_t; /* For process and session IDs */ # endif /* _PID_T */ # ifndef _LWPID_T # define _LWPID_T typedef int32_t lwpid_t; /* For process and session IDs */ # endif /* _LWPID_T */ # ifndef _GID_T # define _GID_T typedef int32_t gid_t; /* For group IDs */ # endif /* _GID_T */ # ifndef _UID_T # define _UID_T typedef int32_t uid_t; /* For user IDs */ # endif /* _UID_T */ # ifndef _TID_T # define _TID_T typedef int32_t tid_t; /* For thread IDs */ # endif /* _TID_T */ # ifndef _SSIZE_T # define _SSIZE_T typedef long ssize_t; # endif /* _SSIZE_T */ # ifndef _SITE_T # define _SITE_T typedef uint16_t __site_t; /* see stat.h */ # endif /* _SITE_T */ # ifndef _CNODE_T # define _CNODE_T typedef uint16_t __cnode_t; /* see stat.h */ # endif /* _CNODE_T */ # ifndef _PRIV_T # define _PRIV_T typedef int32_t priv_t; /* For privileges */ # endif /* _PRIV_T */ # ifndef _PRIVSET_T # define _PRIVSET_T typedef struct __privset privset_t;/* For privilege set */ typedef privset_t priv_set_t; # endif /* _PRIVSET_T */ # ifndef _CMPTID_T # define _CMPTID_T typedef int32_t cid_t; /* For compartment IDs */ typedef cid_t cmpt_t; # endif /* _CMPTID_T */ /* * #endif / * _INCLUDE_POSIX_SOURCE * / */ _NAMESPACE_STD_START #if defined(_INCLUDE_POSIX_SOURCE) || defined(_INCLUDE__STDC__) # ifndef _TIME_T # define _TIME_T # ifdef _KERNEL typedef int32_t time_t; # else typedef long time_t; # endif # endif /* _TIME_T */ #endif /* _INCLUDE_POSIX_SOURCE || _INCLUDE__STDC__ */ #if defined(_INCLUDE_POSIX_SOURCE) || (defined(_INCLUDE__STDC__) && (!defined(_XPG4_EXTENDED) || defined(_INCLUDE_HPUX_SOURCE))) # ifndef _SIZE_T # define _SIZE_T typedef unsigned long size_t; # endif /* _SIZE_T */ #endif /* _INCLUDE_POSIX_SOURCE || (_INCLUDE__STDC__ && (!_XPG4_EXTENDED || _INCLUDE_HPUX_SOURCE)) */ #if defined(_INCLUDE_XOPEN_SOURCE) || (defined(_INCLUDE__STDC__) && (!defined(_XPG4_EXTENDED) || defined(_INCLUDE_HPUX_SOURCE))) # ifndef _CLOCK_T # define _CLOCK_T typedef uint32_t clock_t; /* For clock ticks */ # endif /* _CLOCK_T */ #endif /* _INCLUDE_XOPEN_SOURCE || (_INCLUDE__STDC__ && (!_XPG4_EXTENDED || _INCLUDE_HPUX_SOURCE)) */ _NAMESPACE_STD_END #ifdef _INCLUDE_XOPEN_SOURCE # ifndef _KEY_T # define _KEY_T typedef int32_t key_t; /* For interprocess communication ID */ # endif /* _KEY_T */ typedef unsigned short __ushort; /* Try to avoid using this */ typedef int32_t __daddr_t; /* For disk block addresses */ typedef char *__caddr_t; /* For character addresses */ # if !defined(__STDC_32_MODE__) typedef int64_t __swblk_t; # else typedef int32_t __swblk_t; # endif /* __STDC_32_MODE__ */ #endif /* _INCLUDE_XOPEN_SOURCE */ #ifdef _INCLUDE_AES_SOURCE # ifndef _CADDR_T # define _CADDR_T typedef __caddr_t caddr_t; # endif /* _CADDR_T */ #endif /* _INCLUDE_AES_SOURCE */ #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED # ifndef _ID_T # define _ID_T typedef int32_t id_t; /* For IDs that can be pid_t, uid_t, gid_t */ # endif /* _ID_T */ # ifndef _USECONDS_T # define _USECONDS_T typedef uint32_t useconds_t; /* Time in microseconds */ # endif /* _USECONDS_T */ /* For getrlimit() */ # ifndef _RLIM32_T # define _RLIM32_T typedef uint32_t rlim32_t; # endif /* _RLIM32_T */ # ifndef _RLIM64_T # define _RLIM64_T # if !defined(__STDC_32_MODE__) typedef uint64_t rlim64_t; # endif # endif /* _RLIM64_T */ # ifndef _RLIM_T # define _RLIM_T # if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL) # if !defined(__STDC_32_MODE__) typedef uint64_t rlim_t; # define k_rlim_t rlim_t # endif /* __STDC_32_MODE__ */ # else typedef unsigned long rlim_t; # endif # endif /* _RLIM_T */ /* For "struct statvfs" in statvfs.h */ typedef __site_t site_t; #endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */ #ifdef _INCLUDE_HPUX_SOURCE typedef unsigned char u_char; /* Try to avoid using these */ typedef unsigned short u_short; /* Try to avoid using these */ typedef unsigned int u_int; /* Try to avoid using these */ typedef unsigned long u_long; /* Try to avoid using these */ typedef unsigned int uint; /* Try to avoid using these */ typedef unsigned short ushort; /* Try to avoid using these */ typedef unsigned char ubit8; typedef unsigned short ubit16; typedef uint32_t ubit32; typedef char sbit8; typedef short sbit16; typedef int32_t sbit32; typedef __swblk_t swblk_t; typedef __daddr_t daddr_t; typedef __cnode_t cnode_t; # ifdef _KERNEL /* * daddr_t will be left at 32 bits indefinitely for backward-compatibility * with many on-disk structures and old kernel modules. Use daddr32_t * and daddr64_t to be explicit about the size of disk offsets used in * a given file system. kern_daddr_t will be used in all common kernel * structures and will always track the largest offset width used in * the system. */ typedef int64_t daddr64_t; typedef int32_t daddr32_t; typedef daddr64_t kern_daddr_t; # endif /* _KERNEL */ /* For physical memory and virtual addresses and/or offsets */ #include # ifndef _ULONG_T # define _ULONG_T typedef unsigned long ulong_t; # endif typedef unsigned char uchar_t; typedef unsigned short ushort_t; typedef unsigned int uint_t; typedef int16_t cnt_t; typedef uint32_t cdno_t; typedef uint16_t use_t; typedef struct _physadr { intptr_t r[1]; } *physadr; typedef int spu_t; typedef int ldom_t; # define MAXSUSE 65535 /* maximum share count on swap device */ typedef short cpu_t; /* * Locking declarations used by mod_k.h and stream.h. */ typedef struct lkinfo { char *lk_name; int lk_flags; long lk_pad[2]; } lkinfo_t; typedef unsigned long pl_t; # ifndef _AID_T # define _AID_T typedef int32_t aid_t; # endif /* _AID_T */ /* These probably should be moved to some other header */ # define UID_NO_CHANGE ((uid_t) -1) /* for chown(2) and setresuid(2) */ # define GID_NO_CHANGE ((gid_t) -1) /* for chown(2) and setresgid(2) */ typedef pid_t sid_t; /* For session IDs */ # define PGID_NOT_SET ((pid_t) -1) /* for no pgrp */ # define SID_NOT_SET ((sid_t) -1) /* for no session */ # define PGID_USE_PID ((pid_t) -2) /* set pgrp to pid */ # define SID_USE_PID ((sid_t) -2) /* set session to pid*/ /* Types, macros, etc. for select() */ # ifndef MAXFUPLIM # define __fd_set fd_set # include # undef __fd_set /* NOTE: the other use of ifndef MAXFUPLIM (in _types.h goes away)*/ # define MAXFUPLIM _MAXFUPLIM # define NFDBITS _NFDBITS # ifndef howmany # define howmany(x,y) (((x)+((y)-1))/(y)) # endif typedef __fd_mask fd_mask; # endif /* not MAXFUPLIM */ # ifndef _KERNEL # ifdef __cplusplus extern "C" { # endif /* __cplusplus */ # ifdef _CLASSIC_ID_TYPES # ifdef _SVID3 extern int setpgrp(); # endif /* _SVID3 */ # else /* not _CLASSIC_ID_TYPES */ # ifdef _PROTOTYPES # ifdef _SVID3 extern pid_t setpgrp(void); # endif /* _SVID3 */ # else /* not _PROTOTYPES */ # ifdef _SVID3 extern pid_t setpgrp(); # endif /* _SVID3 */ # endif /* not _PROTOTYPES */ # endif /* not _CLASSIC_ID_TYPES */ # ifdef _PROTOTYPES # ifdef _SVID3 extern int ptrace(int, pid_t, int, int, int); extern int ioctl(int, int, ...); extern int acct(const char *); # endif /* _SVID3 */ # else /* not _PROTOTYPES */ # ifdef _SVID3 extern int ptrace(); extern int ioctl(); extern int acct(); # endif /* _SVID3 */ # endif /* not _PROTOTYPES */ # ifdef __cplusplus } # endif /* __cplusplus */ # endif /* not _KERNEL */ #endif /* _INCLUDE_HPUX_SOURCE */ #if !defined(__STDC_32_MODE__) /* Make these kernel types available as some commands need * these types (via vnode.h). They will be available in * ANSI-EXT mode, K&R or LP64 mode. */ # ifndef _DIR_OFF_T # define _DIR_OFF_T typedef int32_t dir_off_t; # endif #endif /* ! __STDC_32_MODE */ #ifdef _UNSUPPORTED /* * NOTE: The following header file contains information specific * to the internals of the HP-UX implementation. The contents of * this header file are subject to change without notice. Such * changes may affect source code, object code, or binary * compatibility between releases of HP-UX. Code which uses * the symbols contained within this header file is inherently * non-portable (even between HP-UX implementations). */ #include <.unsupp/sys/_types.h> #endif /* _UNSUPPORTED */ #endif /* _SYS_TYPES_INCLUDED */