00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _UNISTD_H_
00040 #define _UNISTD_H_
00041
00042
00043 #ifdef __cplusplus
00044 #include <e32def.h>
00045
00046 extern "C" {
00047 #endif
00048
00049
00050
00051 #include <sys/cdefs.h>
00052 #include <sys/types.h>
00053 #include <sys/unistd.h>
00054 #include <sys/_null.h>
00055 #include <sys/_types.h>
00056
00057 #ifdef __SYMBIAN32__
00058 #include <_ansi.h>
00059
00060 #endif
00061
00062 #ifdef __SYMBIAN32__
00063 __BEGIN_DECLS
00064 IMPORT_C char ***__environ(void);
00065 __END_DECLS
00066 #define environ (*__environ())
00067
00068 #endif
00069
00070 #ifndef _GID_T_DECLARED
00071 typedef __gid_t gid_t;
00072 #define _GID_T_DECLARED
00073 #endif
00074
00075 #ifndef _OFF_T_DECLARED
00076 typedef __off_t off_t;
00077 #define _OFF_T_DECLARED
00078 #endif
00079
00080 #ifndef _PID_T_DECLARED
00081 typedef __pid_t pid_t;
00082 #define _PID_T_DECLARED
00083 #endif
00084
00085 #ifndef _SIZE_T_DECLARED
00086 typedef __size_t size_t;
00087 #define _SIZE_T_DECLARED
00088 #endif
00089
00090 #ifndef _SSIZE_T_DECLARED
00091 typedef __ssize_t ssize_t;
00092 #define _SSIZE_T_DECLARED
00093 #endif
00094
00095 #ifndef _UID_T_DECLARED
00096 typedef __uid_t uid_t;
00097 #define _UID_T_DECLARED
00098 #endif
00099
00100 #ifndef _USECONDS_T_DECLARED
00101 typedef __useconds_t useconds_t;
00102 #define _USECONDS_T_DECLARED
00103 #endif
00104
00105 #define STDIN_FILENO 0
00106 #define STDOUT_FILENO 1
00107 #define STDERR_FILENO 2
00108
00109 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
00110 #define F_ULOCK 0
00111 #define F_LOCK 1
00112 #define F_TLOCK 2
00113 #define F_TEST 3
00114 #endif
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 #define _POSIX_BARRIERS -1
00131 #define _POSIX_READER_WRITER_LOCKS -1
00132 #define _POSIX_REGEXP 1
00133 #define _POSIX_SHELL 1
00134 #define _POSIX_SPAWN -1
00135 #define _POSIX_SPIN_LOCKS -1
00136 #define _POSIX_THREAD_ATTR_STACKADDR -1
00137 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
00138 #define _POSIX_THREAD_CPUTIME -1
00139 #define _POSIX_THREAD_PRIO_INHERIT -1
00140 #define _POSIX_THREAD_PRIO_PROTECT -1
00141 #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
00142 #define _POSIX_THREAD_PROCESS_SHARED -1
00143 #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
00144 #define _POSIX_THREAD_SPORADIC_SERVER -1
00145 #define _POSIX_THREADS 200112L
00146 #define _POSIX_TRACE -1
00147 #define _POSIX_TRACE_EVENT_FILTER -1
00148 #define _POSIX_TRACE_INHERIT -1
00149 #define _POSIX_TRACE_LOG -1
00150 #define _POSIX2_C_BIND 200112L
00151 #define _POSIX2_C_DEV -1
00152 #define _POSIX2_CHAR_TERM 1
00153 #define _POSIX2_FORT_DEV -1
00154 #define _POSIX2_FORT_RUN 200112L
00155 #define _POSIX2_LOCALEDEF -1
00156 #define _POSIX2_PBS -1
00157 #define _POSIX2_PBS_ACCOUNTING -1
00158 #define _POSIX2_PBS_CHECKPOINT -1
00159 #define _POSIX2_PBS_LOCATE -1
00160 #define _POSIX2_PBS_MESSAGE -1
00161 #define _POSIX2_PBS_TRACK -1
00162 #define _POSIX2_SW_DEV -1
00163 #define _POSIX2_UPE 200112L
00164 #define _V6_ILP32_OFF32 -1
00165 #define _V6_ILP32_OFFBIG 0
00166 #define _V6_LP64_OFF64 0
00167 #define _V6_LPBIG_OFFBIG -1
00168
00169 #if __XSI_VISIBLE
00170 #define _XOPEN_CRYPT -1
00171 #define _XOPEN_ENH_I18N -1
00172 #define _XOPEN_LEGACY -1
00173 #define _XOPEN_REALTIME -1
00174 #define _XOPEN_REALTIME_THREADS -1
00175 #define _XOPEN_UNIX -1
00176 #endif
00177
00178
00179 #define _POSIX2_VERSION 199212L
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 #define _SC_ARG_MAX 1
00191 #define _SC_CHILD_MAX 2
00192 #define _SC_CLK_TCK 3
00193 #define _SC_NGROUPS_MAX 4
00194 #define _SC_OPEN_MAX 5
00195 #define _SC_JOB_CONTROL 6
00196 #define _SC_SAVED_IDS 7
00197 #define _SC_VERSION 8
00198 #define _SC_BC_BASE_MAX 9
00199 #define _SC_BC_DIM_MAX 10
00200 #define _SC_BC_SCALE_MAX 11
00201 #define _SC_BC_STRING_MAX 12
00202 #define _SC_COLL_WEIGHTS_MAX 13
00203 #define _SC_EXPR_NEST_MAX 14
00204 #define _SC_LINE_MAX 15
00205 #define _SC_RE_DUP_MAX 16
00206 #define _SC_2_VERSION 17
00207 #define _SC_2_C_BIND 18
00208 #define _SC_2_C_DEV 19
00209 #define _SC_2_CHAR_TERM 20
00210 #define _SC_2_FORT_DEV 21
00211 #define _SC_2_FORT_RUN 22
00212 #define _SC_2_LOCALEDEF 23
00213 #define _SC_2_SW_DEV 24
00214 #define _SC_2_UPE 25
00215 #define _SC_STREAM_MAX 26
00216 #define _SC_TZNAME_MAX 27
00217
00218 #if __POSIX_VISIBLE >= 199309
00219 #define _SC_ASYNCHRONOUS_IO 28
00220 #define _SC_MAPPED_FILES 29
00221 #define _SC_MEMLOCK 30
00222 #define _SC_MEMLOCK_RANGE 31
00223 #define _SC_MEMORY_PROTECTION 32
00224 #define _SC_MESSAGE_PASSING 33
00225 #define _SC_PRIORITIZED_IO 34
00226 #define _SC_PRIORITY_SCHEDULING 35
00227 #define _SC_REALTIME_SIGNALS 36
00228 #define _SC_SEMAPHORES 37
00229 #define _SC_FSYNC 38
00230 #define _SC_SHARED_MEMORY_OBJECTS 39
00231 #define _SC_SYNCHRONIZED_IO 40
00232 #define _SC_TIMERS 41
00233 #define _SC_AIO_LISTIO_MAX 42
00234 #define _SC_AIO_MAX 43
00235 #define _SC_AIO_PRIO_DELTA_MAX 44
00236 #define _SC_DELAYTIMER_MAX 45
00237 #define _SC_MQ_OPEN_MAX 46
00238 #define _SC_PAGESIZE 47
00239 #define _SC_RTSIG_MAX 48
00240 #define _SC_SEM_NSEMS_MAX 49
00241 #define _SC_SEM_VALUE_MAX 50
00242 #define _SC_SIGQUEUE_MAX 51
00243 #define _SC_TIMER_MAX 52
00244 #endif
00245
00246 #if __POSIX_VISIBLE >= 200112
00247 #define _SC_2_PBS 59
00248 #define _SC_2_PBS_ACCOUNTING 60
00249 #define _SC_2_PBS_CHECKPOINT 61
00250 #define _SC_2_PBS_LOCATE 62
00251 #define _SC_2_PBS_MESSAGE 63
00252 #define _SC_2_PBS_TRACK 64
00253 #define _SC_ADVISORY_INFO 65
00254 #define _SC_BARRIERS 66
00255 #define _SC_CLOCK_SELECTION 67
00256 #define _SC_CPUTIME 68
00257 #define _SC_FILE_LOCKING 69
00258 #define _SC_GETGR_R_SIZE_MAX 70
00259 #define _SC_GETPW_R_SIZE_MAX 71
00260 #define _SC_HOST_NAME_MAX 72
00261 #define _SC_LOGIN_NAME_MAX 73
00262 #define _SC_MONOTONIC_CLOCK 74
00263 #define _SC_MQ_PRIO_MAX 75
00264 #define _SC_READER_WRITER_LOCKS 76
00265 #define _SC_REGEXP 77
00266 #define _SC_SHELL 78
00267 #define _SC_SPAWN 79
00268 #define _SC_SPIN_LOCKS 80
00269 #define _SC_SPORADIC_SERVER 81
00270 #define _SC_THREAD_ATTR_STACKADDR 82
00271 #define _SC_THREAD_ATTR_STACKSIZE 83
00272 #define _SC_THREAD_CPUTIME 84
00273 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 85
00274 #define _SC_THREAD_KEYS_MAX 86
00275 #define _SC_THREAD_PRIO_INHERIT 87
00276 #define _SC_THREAD_PRIO_PROTECT 88
00277 #define _SC_THREAD_PRIORITY_SCHEDULING 89
00278 #define _SC_THREAD_PROCESS_SHARED 90
00279 #define _SC_THREAD_SAFE_FUNCTIONS 91
00280 #define _SC_THREAD_SPORADIC_SERVER 92
00281 #define _SC_THREAD_STACK_MIN 93
00282 #define _SC_THREAD_THREADS_MAX 94
00283 #define _SC_TIMEOUTS 95
00284 #define _SC_THREADS 96
00285 #define _SC_TRACE 97
00286 #define _SC_TRACE_EVENT_FILTER 98
00287 #define _SC_TRACE_INHERIT 99
00288 #define _SC_TRACE_LOG 100
00289 #define _SC_TTY_NAME_MAX 101
00290 #define _SC_TYPED_MEMORY_OBJECTS 102
00291 #define _SC_V6_ILP32_OFF32 103
00292 #define _SC_V6_ILP32_OFFBIG 104
00293 #define _SC_V6_LP64_OFF64 105
00294 #define _SC_V6_LPBIG_OFFBIG 106
00295 #define _SC_IPV6 118
00296 #define _SC_RAW_SOCKETS 119
00297 #define _SC_SYMLOOP_MAX 120
00298 #endif
00299
00300 #if __XSI_VISIBLE
00301 #define _SC_ATEXIT_MAX 107
00302 #define _SC_IOV_MAX 56
00303 #define _SC_PAGE_SIZE _SC_PAGESIZE
00304 #define _SC_XOPEN_CRYPT 108
00305 #define _SC_XOPEN_ENH_I18N 109
00306 #define _SC_XOPEN_LEGACY 110
00307 #define _SC_XOPEN_REALTIME 111
00308 #define _SC_XOPEN_REALTIME_THREADS 112
00309 #define _SC_XOPEN_SHM 113
00310 #define _SC_XOPEN_STREAMS 114
00311 #define _SC_XOPEN_UNIX 115
00312 #define _SC_XOPEN_VERSION 116
00313 #define _SC_XOPEN_XCU_VERSION 117
00314 #endif
00315
00316 #if __BSD_VISIBLE
00317 #define _SC_NPROCESSORS_CONF 57
00318 #define _SC_NPROCESSORS_ONLN 58
00319 #endif
00320
00321
00322 #if __POSIX_VISIBLE >= 199209
00323 #define _CS_PATH 1
00324 #endif
00325
00326 #if __POSIX_VISIBLE >= 200112
00327 #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
00328 #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
00329 #define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
00330 #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
00331 #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
00332 #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
00333 #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
00334 #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
00335 #define _CS_POSIX_V6_LP64_OFF64_LIBS 10
00336 #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
00337 #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
00338 #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
00339 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
00340 #endif
00341
00342 __BEGIN_DECLS
00343
00344 IMPORT_C void _exit(int) __dead2;
00345 IMPORT_C int access(const char *, int);
00346 IMPORT_C int chdir(const char *);
00347 IMPORT_C int chown(const char *, uid_t, gid_t);
00348 IMPORT_C int close(int);
00349 IMPORT_C int dup(int);
00350 IMPORT_C int dup2(int, int);
00351 int eaccess(const char *, int);
00352 IMPORT_C long fpathconf(int, int);
00353 IMPORT_C char *getcwd(char *, size_t);
00354 IMPORT_C gid_t getegid(void);
00355 IMPORT_C uid_t geteuid(void);
00356 IMPORT_C gid_t getgid(void);
00357 gid_t _getgid(void);
00358 IMPORT_C int getgroups(int, gid_t []);
00359 char *getlogin(void);
00360 IMPORT_C pid_t getpgrp(void);
00361 IMPORT_C pid_t getpid(void);
00362 IMPORT_C pid_t getppid(void);
00363 IMPORT_C uid_t getuid(void);
00364 uid_t _getuid(void);
00365 IMPORT_C int isatty(int);
00366 IMPORT_C int link(const char *, const char *);
00367 #ifndef _LSEEK_DECLARED
00368 #define _LSEEK_DECLARED
00369 IMPORT_C off_t lseek(int, off_t, int);
00370 #endif
00371 IMPORT_C long pathconf(const char *, int);
00372 IMPORT_C int pipe(int *);
00373 IMPORT_C ssize_t read(int, void *, size_t);
00374 IMPORT_C int rmdir(const char *);
00375 IMPORT_C int setgid(gid_t);
00376 IMPORT_C int setpgid(pid_t, pid_t);
00377 void setproctitle(const char *_fmt, ...) __printf0like(1, 2);
00378 IMPORT_C pid_t setsid(void);
00379 IMPORT_C int setuid(uid_t);
00380 IMPORT_C unsigned int sleep(unsigned int);
00381 IMPORT_C
00382 long sysconf(int);
00383 IMPORT_C int unlink(const char *);
00384 IMPORT_C ssize_t write(int, const void *, size_t);
00385
00386 #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
00387 IMPORT_C size_t confstr(int, char *, size_t);
00388 #ifndef _GETOPT_DECLARED
00389 #define _GETOPT_DECLARED
00390 IMPORT_C int getopt(int, char * const [], const char *);
00391
00392 #ifndef __SYMBIAN32__
00393 extern char *optarg;
00394 extern int optind, opterr, optopt;
00395 #else
00396 IMPORT_C int *__optopt(void);
00397 IMPORT_C int *__opterr(void);
00398 IMPORT_C int *__optind(void);
00399 IMPORT_C char **__optarg(void);
00400 #define optopt (*__optopt())
00401 #define opterr (*__opterr())
00402 #define optind (*__optind())
00403 #define optarg (*__optarg())
00404 #endif
00405
00406 #endif
00407 #endif
00408
00409
00410 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
00411 IMPORT_C int fsync(int);
00412 IMPORT_C int fdatasync(int);
00413
00414
00415
00416
00417 #ifndef _FTRUNCATE_DECLARED
00418 #define _FTRUNCATE_DECLARED
00419 IMPORT_C int ftruncate(int, off_t);
00420 #endif
00421 #endif
00422
00423 #if __POSIX_VISIBLE >= 199506
00424
00425 #ifdef __SYMBIAN_COMPILE_UNUSED__
00426 int getlogin_r(char *, int);
00427 #endif
00428
00429 #endif
00430
00431
00432 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
00433 IMPORT_C int readlink(const char *, char *, int);
00434 #endif
00435 #if __POSIX_VISIBLE >= 200112
00436 IMPORT_C int gethostname(char *, size_t);
00437 IMPORT_C int setegid(gid_t);
00438 IMPORT_C int seteuid(uid_t);
00439 #endif
00440
00441
00442
00443
00444
00445
00446 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE
00447 IMPORT_C int symlink(const char * __restrict, const char * __restrict);
00448 #endif
00449
00450
00451 #if __XSI_VISIBLE
00452 char *crypt(const char *, const char *);
00453
00454 int encrypt(char *, int);
00455 IMPORT_C int fchdir(int);
00456 IMPORT_C int getpgid(pid_t _pid);
00457 IMPORT_C int lchown(const char *, uid_t, gid_t);
00458 IMPORT_C int nice(int);
00459 IMPORT_C int setpgrp(pid_t _pid, pid_t _pgrp);
00460 IMPORT_C int setregid(gid_t, gid_t);
00461 IMPORT_C int setreuid(uid_t, uid_t);
00462
00463 #ifndef _SWAB_DECLARED
00464 #define _SWAB_DECLARED
00465 IMPORT_C
00466 void swab(const void * __restrict, void * __restrict, ssize_t);
00467 #endif
00468
00469 void sync(void);
00470 IMPORT_C int usleep(useconds_t);
00471
00472
00473 #ifndef _TRUNCATE_DECLARED
00474 #define _TRUNCATE_DECLARED
00475 IMPORT_C int truncate(const char *, off_t);
00476 #endif
00477 #endif
00478
00479 #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
00480 IMPORT_C int brk(const void *);
00481 IMPORT_C int getdtablesize(void);
00482 IMPORT_C int getpagesize(void) __pure2;
00483 #endif
00484
00485 #if __BSD_VISIBLE
00486 struct timeval;
00487 IMPORT_C int initgroups(const char *, gid_t);
00488 IMPORT_C int issetugid(void);
00489
00490 #ifdef __SYMBIAN_COMPILE_UNUSED__
00491 char *mkdtemp(char *);
00492 #endif
00493
00494 #ifndef _MKNOD_DECLARED
00495 int mknod(const char *, mode_t, dev_t);
00496 #define _MKNOD_DECLARED
00497 #endif
00498 #ifndef _MKSTEMP_DECLARED
00499 IMPORT_C int mkstemp(char *);
00500 #define _MKSTEMP_DECLARED
00501 #endif
00502
00503 #ifdef __SYMBIAN_COMPILE_UNUSED__
00504 int mkstemps(char *, int);
00505 #endif
00506
00507 #ifndef _MKTEMP_DECLARED
00508
00509 #ifdef __SYMBIAN_COMPILE_UNUSED__
00510 char *mktemp(char *);
00511 #endif
00512
00513 #define _MKTEMP_DECLARED
00514 #endif
00515 int nfssvc(int, void *);
00516
00517 #if __BSD_VISIBLE
00518 #ifndef __SYMBIAN32__
00519 #ifndef _SELECT_DECLARED
00520 #define _SELECT_DECLARED
00521 IMPORT_C int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
00522
00523 #endif
00524
00525 #endif
00526
00527 #endif
00528
00529 IMPORT_C int setgroups(int, const gid_t *);
00530 #ifndef _SETKEY_DECLARED
00531 int setkey(const char *);
00532 #define _SETKEY_DECLARED
00533 #endif
00534
00535 #ifndef _OPTRESET_DECLARED
00536 #define _OPTRESET_DECLARED
00537 #ifndef __SYMBIAN32__
00538 extern int optreset;
00539 #else
00540 IMPORT_C int *__optreset(void);
00541 #define optreset (*__optreset())
00542 #endif
00543
00544 #ifdef __SYMBIAN32__
00545 #ifndef __XSI_VISIBLE
00546 void encrypt(char block[], int edflag);
00547 char *crypt(const char *key, const char *salt);
00548 #endif
00549 #endif
00550
00551 #endif
00552 #endif
00553 __END_DECLS
00554
00555
00556 #ifdef __cplusplus
00557 }
00558 #endif
00559
00560
00561 #endif