From de47eb59bb829423b1d0f47ba13099073999b3cb Mon Sep 17 00:00:00 2001 From: Nicolas Planel Date: Wed, 29 Oct 2003 16:07:11 +0000 Subject: Corporate Server 2.1.1 release --- mdk-stage1/dietlibc/include/sys/types.h | 136 +++++++++++++++++++++++++++----- 1 file changed, 118 insertions(+), 18 deletions(-) (limited to 'mdk-stage1/dietlibc/include/sys/types.h') diff --git a/mdk-stage1/dietlibc/include/sys/types.h b/mdk-stage1/dietlibc/include/sys/types.h index 34dbaa9f1..a3d2bf4be 100644 --- a/mdk-stage1/dietlibc/include/sys/types.h +++ b/mdk-stage1/dietlibc/include/sys/types.h @@ -1,33 +1,133 @@ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H -#include -#include -#include - -#ifdef __GNUC__ -#define __quad_t __quad_t -typedef long long int __quad_t; -typedef unsigned long long int __u_quad_t; +#include +#include + +typedef unsigned long int blkcnt_t; /* Used for file block counts */ +typedef unsigned long int blksize_t; /* Used for block sizes */ +typedef unsigned long int clock_t; /* Used for system times in + clock ticks or CLOCKS_PER_SEC + (see ). */ + +/* TODO: + clockid_t + Used for clock ID type in the clock and timer functions. + fsblkcnt_t + Used for file system block counts + fsfilcnt_t + Used for file system file counts + pthread_attr_t + Used to identify a thread attribute object. + pthread_cond_t + Used for condition variables. + pthread_condattr_t + Used to identify a condition attribute object. + pthread_key_t + Used for thread-specific data keys. + pthread_mutex_t + Used for mutexes. + pthread_mutexattr_t + Used to identify a mutex attribute object. + pthread_once_t + Used for dynamic package initialisation. + pthread_rwlock_t + Used for read-write locks. + pthread_rwlockattr_t + Used for read-write lock attributes. + pthread_t + Used to identify a thread. + timer_t + Used for timer ID returned by timer_create(). +*/ + +#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__hppa__) || defined(__sparc64__) \ + || defined(__x86_64__) || defined(__ia64__) +typedef unsigned int uid_t; /* Used for user IDs. */ +typedef unsigned int gid_t; /* Used for group IDs. */ +typedef unsigned int dev_t; /* Used for device IDs. */ #else -#warning no long long support - no 64 bit file I/O support -typedef long int __quad_t; -typedef unsigned long int __u_quad_t; +typedef unsigned short uid_t; /* Used for user IDs. */ +typedef unsigned short gid_t; /* Used for group IDs. */ +typedef unsigned short dev_t; /* Used for device IDs. */ #endif +#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__sparc64__) \ + || defined(__x86_64__) || defined(__ia64__) +typedef unsigned int mode_t; /* Used for some file attributes. */ +#else +typedef unsigned short mode_t; /* Used for some file attributes. */ +#endif -#ifdef __quad_t -typedef __quad_t off64_t; -typedef __u_quad_t ino64_t; -typedef __quad_t blkcnt64_t; +#if defined(__alpha__) || defined(__mips__) || defined(__sparc64__) \ + || defined(__x86_64__) || defined(__ia64__) +typedef unsigned int nlink_t; /* Used for link counts. */ +#else +typedef unsigned short nlink_t; /* Used for link counts. */ #endif +typedef signed int id_t; /* Used as a general identifier; can be + used to contain at least a pid_t, + uid_t or a gid_t. */ +typedef unsigned long ino_t; /* Used for file serial numbers. */ +typedef signed int key_t; /* Used for interprocess communication. */ +typedef signed int pid_t; /* Used for process IDs and process group IDs. */ +typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ +typedef signed long suseconds_t; /* Used for time in microseconds. */ +typedef signed long time_t; /* Used for time in seconds. */ +typedef signed long useconds_t; /* Used for time in microseconds. */ + +/* non-susv2 types: */ +__extension__ typedef signed long long loff_t; /* 64-bit offset */ + +__extension__ typedef signed long long off64_t; +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 +typedef off64_t off_t; +#else +typedef signed long off_t; /* Used for file sizes. */ +#endif + +__extension__ typedef unsigned long long ino64_t; +__extension__ typedef signed long long blkcnt64_t; + +typedef uint32_t uid32_t; +typedef uint32_t gid32_t; + typedef long int fpos_t; -#define socklen_t socklen_t +#define __socklen_t_defined typedef unsigned int socklen_t; +typedef unsigned short sa_family_t; -typedef long int blksize_t; -typedef long int blkcnt_t; +#ifdef _BSD_SOURCE +/* die, BSD, die! */ +typedef uint16_t nshort; +typedef uint32_t ntime; +typedef uint32_t nlong; +typedef uint32_t ulong; +typedef uint16_t n_short; +typedef uint32_t n_time; +typedef uint32_t n_long; +# ifndef __dietlibc_u_char_defined +typedef char* caddr_t; +typedef uint32_t u_long; +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +# define __dietlibc_u_char_defined +# endif +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; +#endif + +#ifdef _GNU_SOURCE +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +#ifndef __STRICT_ANSI__ +typedef uint64_t u_int64_t; +#endif +#endif #endif -- cgit v1.2.1