00001 /* clib/include/sys/types.h 00002 * 00003 * Provides standard types 00004 * 00005 * Copyright 2003 Simtec Electronics 00006 * 00007 * Permission is hereby granted, free of charge, to any person 00008 * obtaining a copy of this software and associated documentation 00009 * files (the "Software"), to deal in the Software without 00010 * restriction, including without limitation the rights to use, copy, 00011 * modify, merge, publish, distribute, sublicense, and/or sell copies 00012 * of the Software, and to permit persons to whom the Software is 00013 * furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be 00016 * included in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00021 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00022 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00023 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00024 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00025 * SOFTWARE. 00026 * 00027 */ 00028 00029 #ifndef _ABLE_CLIB_SYS_TYPES_H 00030 #define _ABLE_CLIB_SYS_TYPES_H 1 00031 00032 /* strictly this shouldnt be here but a lot of things assume it is */ 00033 #include <stdint.h> 00034 00035 typedef int off_t; 00036 00037 typedef off_t fpos_t; 00038 00039 typedef unsigned long long loff_t; 00040 typedef loff_t off64_t; 00041 00042 typedef unsigned char bool_t; 00043 00044 #if ! defined(_SIZE_T) 00045 #define _SIZE_T 00046 typedef unsigned int size_t; 00047 #endif 00048 00049 #define _SSIZE_T 00050 typedef signed int ssize_t; 00051 00052 /* long size types - dunno if this is right but... */ 00053 typedef unsigned long long lsize_t; 00054 typedef signed long long lssize_t; 00055 00056 /* linux/unix defines */ 00057 typedef unsigned long ino_t; 00058 typedef unsigned short mode_t; 00059 typedef unsigned long dev_t; 00060 typedef unsigned int nlink_t; 00061 typedef unsigned short gid_t; 00062 typedef unsigned short uid_t; 00063 typedef unsigned int pid_t; 00064 00065 /* types for time */ 00066 typedef unsigned long long time_t; /* seconds */ 00067 typedef signed long suseconds_t; /* microseconds */ 00068 00069 typedef unsigned char uchar; 00070 typedef unsigned short ushort; 00071 typedef unsigned int uint; 00072 typedef unsigned long ulong; 00073 00074 typedef unsigned long long daddr_t; /* think disk address type */ 00075 00076 #ifndef _PTRDIFF_T 00077 #define _PTRDIFF_T 00078 typedef signed int ptrdiff_t; /* Pointer differences */ 00079 #endif 00080 00081 typedef unsigned char __u8; 00082 typedef unsigned short __u16; 00083 typedef unsigned int __u32; 00084 typedef unsigned long long __u64; 00085 00086 typedef signed char __s8; 00087 typedef signed short __s16; 00088 typedef signed int __s32; 00089 typedef signed long long __s64; 00090 00091 #define u64_t __u64 00092 #define u32_t __u32 00093 #define u16_t __u16 00094 #define u8_t __u8 00095 00096 #define s64_t __s64 00097 #define s32_t __s32 00098 #define s16_t __s16 00099 #define s8_t __s8 00100 00101 /* think these are only here for cyclone */ 00102 typedef unsigned char u_int8_t; 00103 typedef unsigned short u_int16_t; 00104 typedef unsigned int u_int32_t; 00105 00106 /* NetBSD compat */ 00107 00108 typedef unsigned long long u_quad_t; 00109 typedef signed long long quad_t; 00110 00111 /* more cyclone stuff... */ 00112 00113 typedef unsigned short u_short; 00114 typedef unsigned int u_int; 00115 typedef unsigned char u_char; 00116 typedef unsigned long u_long; 00117 00118 typedef unsigned long caddr_t; 00119 typedef unsigned long long qaddr_t; 00120 00121 #ifndef NULL 00122 #define NULL ((void *)0) 00123 #endif 00124 00125 typedef unsigned long ioaddr_t; 00126 00127 #ifndef LITTLE_ENDIAN 00128 #define LITTLE_ENDIAN (1) 00129 #endif 00130 00131 #ifndef BIG_ENDIAN 00132 #define BIG_ENDIAN (2) 00133 #endif 00134 00135 #ifndef BYTE_ORDER 00136 #define BYTE_ORDER LITTLE_ENDIAN 00137 #endif 00138 00139 #define SIZE_MAX (4294967295U) 00140 00141 typedef int socklen_t ; 00142 00143 /* A lot of things assume fd_set is brought in here */ 00144 #include <sys/select.h> 00145 00146 #endif /* _ABLE_CLIB_SYS_TYPES_H */