1 #ifndef CYGONCE_ISO_SYS_TYPES_H 2 #define CYGONCE_ISO_SYS_TYPES_H 3 /*======================================================================== 4 // 5 // sys/types.h 6 // 7 // POSIX types 8 // 9 //======================================================================== 10 // ####ECOSGPLCOPYRIGHTBEGIN#### 11 // ------------------------------------------- 12 // This file is part of eCos, the Embedded Configurable Operating System. 13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 14 // 15 // eCos is free software; you can redistribute it and/or modify it under 16 // the terms of the GNU General Public License as published by the Free 17 // Software Foundation; either version 2 or (at your option) any later 18 // version. 19 // 20 // eCos is distributed in the hope that it will be useful, but WITHOUT 21 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 23 // for more details. 24 // 25 // You should have received a copy of the GNU General Public License 26 // along with eCos; if not, write to the Free Software Foundation, Inc., 27 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 28 // 29 // As a special exception, if other files instantiate templates or use 30 // macros or inline functions from this file, or you compile this file 31 // and link it with other works to produce a work based on this file, 32 // this file does not by itself cause the resulting work to be covered by 33 // the GNU General Public License. However the source code for this file 34 // must still be made available in accordance with section (3) of the GNU 35 // General Public License v2. 36 // 37 // This exception does not invalidate any other reasons why a work based 38 // on this file might be covered by the GNU General Public License. 39 // ------------------------------------------- 40 // ####ECOSGPLCOPYRIGHTEND#### 41 //======================================================================== 42 //#####DESCRIPTIONBEGIN#### 43 // 44 // Author(s): jlarmour 45 // Contributors: 46 // Date: 2000-04-14 47 // Purpose: This file provides various types required by POSIX 1003.1. 48 // Description: The real contents of this file get set from the 49 // configuration (set by the implementation) 50 // Usage: #include <sys/types.h> 51 // 52 //####DESCRIPTIONEND#### 53 // 54 //====================================================================== 55 */ 56 57 /* CONFIGURATION */ 58 59 //#include <pkgconf/system.h> 60 //#include <pkgconf/isoinfra.h> /* Configuration header */ 61 62 /* INCLUDES */ 63 64 /* This is the "standard" way to get size_t from stddef.h, 65 * which is the canonical location of the definition. 66 */ 67 //#define __need_size_t 68 //#include <stddef.h> 69 #include "port/codes.h" 70 71 /* 72 #ifndef dev_t 73 typedef short dev_t; 74 #endif 75 76 #ifndef ino_t 77 typedef unsigned int ino_t; 78 #endif 79 80 #ifndef mode_t 81 typedef unsigned int mode_t; 82 #endif 83 */ 84 85 typedef unsigned short nlink_t; 86 typedef long off_t; 87 88 typedef unsigned short gid_t; 89 typedef unsigned short uid_t; 90 typedef int pid_t; 91 92 // 93 typedef void *cyg_io_handle_t; 94 95 /* Variable names for pathconf() */ 96 #define _PC_ASYNC_IO 1 97 #define _PC_CHOWN_RESTRICTED 2 98 #define _PC_LINK_MAX 3 99 #define _PC_MAX_CANON 4 100 #define _PC_MAX_INPUT 5 101 #define _PC_NAME_MAX 6 102 #define _PC_NO_TRUNC 7 103 #define _PC_PATH_MAX 8 104 #define _PC_PIPE_BUF 9 105 #define _PC_PRIO_IO 10 106 #define _PC_SYNC_IO 11 107 #define _PC_VDISABLE 12 108 109 //limit.h 110 /* DEFINES */ 111 112 /*----------------------------------------------------------------------------- 113 * Minimum values from POSIX.1 tables 2-3, 2-7 and 2-7a. 114 115 * These are the standard-mandated minimum values. 116 * These values do not vary with the implementation - they may 117 * simply be defined 118 */ 119 120 /* Minimum number of operations in one list I/O call. */ 121 #define _POSIX_AIO_LISTIO_MAX 2 122 123 /* Minimal number of outstanding asynchronous I/O operations. */ 124 #define _POSIX_AIO_MAX 1 125 126 /* Maximum length of arguments to `execve', including environment. */ 127 #define _POSIX_ARG_MAX 4096 128 129 /* Maximum simultaneous processes per real user ID. */ 130 #define _POSIX_CHILD_MAX 6 131 132 /* Minimal number of timer expiration overruns. */ 133 #define _POSIX_DELAYTIMER_MAX 32 134 135 /* Maximum link count of a file. */ 136 #define _POSIX_LINK_MAX 8 137 138 /* Size of storage required for a login name */ 139 #define _POSIX_LOGIN_NAME_MAX 9 140 141 /* Number of bytes in a terminal canonical input queue. */ 142 #define _POSIX_MAX_CANON 255 143 144 /* Number of bytes for which space will be 145 available in a terminal input queue. */ 146 #define _POSIX_MAX_INPUT 255 147 148 /* Maximum number of message queues open for a process. */ 149 #define _POSIX_MQ_OPEN_MAX 8 150 151 /* Maximum number of supported message priorities. */ 152 #define _POSIX_MQ_PRIO_MAX 32 153 154 /* Number of bytes in a filename. */ 155 #define _POSIX_NAME_MAX 14 156 157 /* Number of simultaneous supplementary group IDs per process. */ 158 #define _POSIX_NGROUPS_MAX 0 159 160 /* Number of files one process can have open at once. */ 161 #define _POSIX_OPEN_MAX 16 162 163 /* Number of bytes in a pathname. */ 164 #define _POSIX_PATH_MAX 255 165 166 /* Number of bytes than can be written atomically to a pipe. */ 167 #define _POSIX_PIPE_BUF 512 168 169 /* Minimal number of realtime signals reserved for the application. */ 170 #define _POSIX_RTSIG_MAX 8 171 172 /* Number of semaphores a process can have. */ 173 #define _POSIX_SEM_NSEMS_MAX 256 174 175 /* Maximal value of a semaphore. */ 176 #define _POSIX_SEM_VALUE_MAX 32767 177 178 /* Number of pending realtime signals. */ 179 #define _POSIX_SIGQUEUE_MAX 32 180 181 /* Largest value of a `ssize_t'. */ 182 #define _POSIX_SSIZE_MAX 32767 183 184 /* Number of streams a process can have open at once. */ 185 #define _POSIX_STREAM_MAX 8 186 187 /* Controlling the iterations of destructors for thread-specific data. */ 188 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 189 190 /* The number of data keys per process. */ 191 #define _POSIX_THREAD_KEYS_MAX 128 192 193 /* The number of threads per process. */ 194 #define _POSIX_THREAD_THREADS_MAX 64 195 196 /* Maximum number of characters in a tty name. */ 197 #define _POSIX_TTY_NAME_MAX 9 198 199 /* Number of timer for a process. */ 200 #define _POSIX_TIMER_MAX 32 201 202 /* Maximum length of a timezone name (element of `tzname'). */ 203 #define _POSIX_TZNAME_MAX 3 204 205 /* Maximum clock resolution in nanoseconds. */ 206 #define _POSIX_CLOCKRES_MIN 20000000 207 208 209 #ifdef CYGBLD_ISO_SSIZET_HEADER 210 # include CYGBLD_ISO_SSIZET_HEADER 211 #else 212 # ifndef __STRICT_ANSI__ 213 # define SSIZE_MAX LONG_MAX 214 # endif 215 #endif 216 217 /* INCLUDES */ 218 219 #ifdef CYGBLD_ISO_OPEN_MAX_HEADER 220 # include CYGBLD_ISO_OPEN_MAX_HEADER 221 #else 222 # ifndef __STRICT_ANSI__ 223 # define OPEN_MAX _POSIX_OPEN_MAX 224 # endif 225 #endif 226 227 #ifdef CYGBLD_ISO_LINK_MAX_HEADER 228 # include CYGBLD_ISO_LINK_MAX_HEADER 229 #else 230 # ifndef __STRICT_ANSI__ 231 # define LINK_MAX _POSIX_LINK_MAX 232 # endif 233 #endif 234 235 #ifdef CYGBLD_ISO_NAME_MAX_HEADER 236 # include CYGBLD_ISO_NAME_MAX_HEADER 237 #else 238 # ifndef __STRICT_ANSI__ 239 # define NAME_MAX _POSIX_NAME_MAX 240 # endif 241 #endif 242 243 #ifdef CYGBLD_ISO_PATH_MAX_HEADER 244 # include CYGBLD_ISO_PATH_MAX_HEADER 245 #else 246 # ifndef __STRICT_ANSI__ 247 # define PATH_MAX _POSIX_PATH_MAX 248 # endif 249 #endif 250 251 #if CYGINT_ISO_POSIX_LIMITS 252 # ifdef CYGBLD_ISO_POSIX_LIMITS_HEADER 253 # include CYGBLD_ISO_POSIX_LIMITS_HEADER 254 # endif 255 #endif 256 257 258 #define CYGNUM_FILEIO_MTAB_MAX 16 259 260 //----------------------------------------------- 261 // stat.h need by fs-ecos.h 262 //----------------------------------------------- 263 #define __stat_mode_DIR (1<<0) 264 #define __stat_mode_CHR (1<<1) 265 #define __stat_mode_BLK (1<<2) 266 #define __stat_mode_REG (1<<3) 267 #define __stat_mode_FIFO (1<<4) 268 #define __stat_mode_MQ (1<<5) 269 #define __stat_mode_SEM (1<<6) 270 #define __stat_mode_SHM (1<<7) 271 #define __stat_mode_LNK (1<<8) 272 #define __stat_mode_SOCK (1<<9) 273 274 #if defined(MSVC) 275 /* for time_t */ 276 #include <time.h> 277 typedef unsigned long mode_t; 278 typedef unsigned int ino_t; 279 typedef unsigned int dev_t; 280 typedef long ssize_t; 281 #elif defined(__CC_ARM) 282 #define mode_t unsigned long 283 typedef unsigned int ino_t; 284 typedef unsigned int dev_t; 285 typedef long ssize_t; 286 typedef long time_t; 287 #elif defined(__GNUC__) && !defined(__CC_ARM) 288 #include <sys/types.h> 289 #endif 290 291 #endif /* CYGONCE_ISO_SYS_TYPES_H multiple inclusion protection */ 292 293 /* EOF sys/types.h */ 294 295