1.1 --- a/epoc32/include/stdapis/unistd.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/unistd.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,550 @@
1.4 -unistd.h
1.5 +/*-
1.6 + * © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.7 + * © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
1.8 + * Copyright (c) 1991, 1993, 1994
1.9 + * The Regents of the University of California. All rights reserved.
1.10 + *
1.11 + * Redistribution and use in source and binary forms, with or without
1.12 + * modification, are permitted provided that the following conditions
1.13 + * are met:
1.14 + * 1. Redistributions of source code must retain the above copyright
1.15 + * notice, this list of conditions and the following disclaimer.
1.16 + * 2. Redistributions in binary form must reproduce the above copyright
1.17 + * notice, this list of conditions and the following disclaimer in the
1.18 + * documentation and/or other materials provided with the distribution.
1.19 + * 4. Neither the name of the University nor the names of its contributors
1.20 + * may be used to endorse or promote products derived from this software
1.21 + * without specific prior written permission.
1.22 + *
1.23 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1.24 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.25 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.26 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1.27 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.28 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.29 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.30 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.31 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.32 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.33 + * SUCH DAMAGE.
1.34 + * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
1.35 + * @(#)unistd.h 8.12 (Berkeley) 4/27/95
1.36 + * $FreeBSD: src/include/unistd.h,v 1.78 2005/05/13 16:27:30 delphij Exp $
1.37 + */
1.38 +
1.39 +#ifndef _UNISTD_H_
1.40 +#define _UNISTD_H_
1.41 +
1.42 +//---
1.43 +#ifdef __cplusplus
1.44 +#include <e32def.h>
1.45 +
1.46 +extern "C" {
1.47 +#endif
1.48 +
1.49 +//---
1.50 +
1.51 +#include <sys/cdefs.h>
1.52 +#include <sys/types.h> /* XXX adds too much pollution. */
1.53 +#include <sys/unistd.h>
1.54 +#include <sys/_null.h>
1.55 +#include <sys/_types.h>
1.56 +
1.57 +#ifdef __SYMBIAN32__
1.58 +#include <_ansi.h>
1.59 +#endif //__SYMBIAN32__
1.60 +
1.61 +#ifdef __SYMBIAN32__
1.62 +__BEGIN_DECLS
1.63 +IMPORT_C char ***__environ(void);
1.64 +__END_DECLS
1.65 +#define environ (*__environ())
1.66 +#endif //__SYMBIAN32__
1.67 +
1.68 +#ifndef _GID_T_DECLARED
1.69 +typedef __gid_t gid_t;
1.70 +#define _GID_T_DECLARED
1.71 +#endif
1.72 +
1.73 +#ifndef _OFF_T_DECLARED
1.74 +typedef __off_t off_t;
1.75 +#define _OFF_T_DECLARED
1.76 +#endif
1.77 +
1.78 +#ifndef _PID_T_DECLARED
1.79 +typedef __pid_t pid_t;
1.80 +#define _PID_T_DECLARED
1.81 +#endif
1.82 +
1.83 +#ifndef _SIZE_T_DECLARED
1.84 +typedef __size_t size_t;
1.85 +#define _SIZE_T_DECLARED
1.86 +#endif
1.87 +
1.88 +#ifndef _SSIZE_T_DECLARED
1.89 +typedef __ssize_t ssize_t;
1.90 +#define _SSIZE_T_DECLARED
1.91 +#endif
1.92 +
1.93 +#ifndef _UID_T_DECLARED
1.94 +typedef __uid_t uid_t;
1.95 +#define _UID_T_DECLARED
1.96 +#endif
1.97 +
1.98 +#ifndef _USECONDS_T_DECLARED
1.99 +typedef __useconds_t useconds_t;
1.100 +#define _USECONDS_T_DECLARED
1.101 +#endif
1.102 +
1.103 +#define STDIN_FILENO 0 /* standard input file descriptor */
1.104 +#define STDOUT_FILENO 1 /* standard output file descriptor */
1.105 +#define STDERR_FILENO 2 /* standard error file descriptor */
1.106 +
1.107 +#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
1.108 +#define F_ULOCK 0 /* unlock locked section */
1.109 +#define F_LOCK 1 /* lock a section for exclusive use */
1.110 +#define F_TLOCK 2 /* test and lock a section for exclusive use */
1.111 +#define F_TEST 3 /* test a section for locks by other procs */
1.112 +#endif
1.113 +
1.114 +/*
1.115 + * POSIX options and option groups we unconditionally do or don't
1.116 + * implement. This list includes those options which are exclusively
1.117 + * implemented (or not) in user mode. Please keep this list in
1.118 + * alphabetical order.
1.119 + *
1.120 + * Anything which is defined as zero below **must** have an
1.121 + * implementation for the corresponding sysconf() which is able to
1.122 + * determine conclusively whether or not the feature is supported.
1.123 + * Anything which is defined as other than -1 below **must** have
1.124 + * complete headers, types, and function declarations as specified by
1.125 + * the POSIX standard; however, if the relevant sysconf() function
1.126 + * returns -1, the functions may be stubbed out.
1.127 + */
1.128 +#define _POSIX_BARRIERS -1
1.129 +#define _POSIX_READER_WRITER_LOCKS -1
1.130 +#define _POSIX_REGEXP 1
1.131 +#define _POSIX_SHELL 1
1.132 +#define _POSIX_SPAWN -1
1.133 +#define _POSIX_SPIN_LOCKS -1
1.134 +#define _POSIX_THREAD_ATTR_STACKADDR -1
1.135 +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
1.136 +#define _POSIX_THREAD_CPUTIME -1
1.137 +#define _POSIX_THREAD_PRIO_INHERIT -1
1.138 +#define _POSIX_THREAD_PRIO_PROTECT -1
1.139 +#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
1.140 +#define _POSIX_THREAD_PROCESS_SHARED -1
1.141 +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
1.142 +#define _POSIX_THREAD_SPORADIC_SERVER -1
1.143 +#define _POSIX_THREADS 200112L
1.144 +#define _POSIX_TRACE -1
1.145 +#define _POSIX_TRACE_EVENT_FILTER -1
1.146 +#define _POSIX_TRACE_INHERIT -1
1.147 +#define _POSIX_TRACE_LOG -1
1.148 +#define _POSIX2_C_BIND 200112L /* mandatory */
1.149 +#define _POSIX2_C_DEV -1 /* need c99 utility */
1.150 +#define _POSIX2_CHAR_TERM 1
1.151 +#define _POSIX2_FORT_DEV -1 /* need fort77 utility */
1.152 +#define _POSIX2_FORT_RUN 200112L
1.153 +#define _POSIX2_LOCALEDEF -1
1.154 +#define _POSIX2_PBS -1
1.155 +#define _POSIX2_PBS_ACCOUNTING -1
1.156 +#define _POSIX2_PBS_CHECKPOINT -1
1.157 +#define _POSIX2_PBS_LOCATE -1
1.158 +#define _POSIX2_PBS_MESSAGE -1
1.159 +#define _POSIX2_PBS_TRACK -1
1.160 +#define _POSIX2_SW_DEV -1 /* XXX ??? */
1.161 +#define _POSIX2_UPE 200112L
1.162 +#define _V6_ILP32_OFF32 -1
1.163 +#define _V6_ILP32_OFFBIG 0
1.164 +#define _V6_LP64_OFF64 0
1.165 +#define _V6_LPBIG_OFFBIG -1
1.166 +
1.167 +#if __XSI_VISIBLE
1.168 +#define _XOPEN_CRYPT -1 /* XXX ??? */
1.169 +#define _XOPEN_ENH_I18N -1 /* mandatory in XSI */
1.170 +#define _XOPEN_LEGACY -1
1.171 +#define _XOPEN_REALTIME -1
1.172 +#define _XOPEN_REALTIME_THREADS -1
1.173 +#define _XOPEN_UNIX -1
1.174 +#endif
1.175 +
1.176 +/* Define the POSIX.2 version we target for compliance. */
1.177 +#define _POSIX2_VERSION 199212L
1.178 +
1.179 +/*
1.180 + * POSIX-style system configuration variable accessors (for the
1.181 + * sysconf function). The kernel does not directly implement the
1.182 + * sysconf() interface; rather, a C library stub translates references
1.183 + * to sysconf() into calls to sysctl() using a giant switch statement.
1.184 + * Those that are marked `user' are implemented entirely in the C
1.185 + * library and never query the kernel. pathconf() is implemented
1.186 + * directly by the kernel so those are not defined here.
1.187 + */
1.188 +#define _SC_ARG_MAX 1
1.189 +#define _SC_CHILD_MAX 2
1.190 +#define _SC_CLK_TCK 3
1.191 +#define _SC_NGROUPS_MAX 4
1.192 +#define _SC_OPEN_MAX 5
1.193 +#define _SC_JOB_CONTROL 6
1.194 +#define _SC_SAVED_IDS 7
1.195 +#define _SC_VERSION 8
1.196 +#define _SC_BC_BASE_MAX 9 /* user */
1.197 +#define _SC_BC_DIM_MAX 10 /* user */
1.198 +#define _SC_BC_SCALE_MAX 11 /* user */
1.199 +#define _SC_BC_STRING_MAX 12 /* user */
1.200 +#define _SC_COLL_WEIGHTS_MAX 13 /* user */
1.201 +#define _SC_EXPR_NEST_MAX 14 /* user */
1.202 +#define _SC_LINE_MAX 15 /* user */
1.203 +#define _SC_RE_DUP_MAX 16 /* user */
1.204 +#define _SC_2_VERSION 17 /* user */
1.205 +#define _SC_2_C_BIND 18 /* user */
1.206 +#define _SC_2_C_DEV 19 /* user */
1.207 +#define _SC_2_CHAR_TERM 20 /* user */
1.208 +#define _SC_2_FORT_DEV 21 /* user */
1.209 +#define _SC_2_FORT_RUN 22 /* user */
1.210 +#define _SC_2_LOCALEDEF 23 /* user */
1.211 +#define _SC_2_SW_DEV 24 /* user */
1.212 +#define _SC_2_UPE 25 /* user */
1.213 +#define _SC_STREAM_MAX 26 /* user */
1.214 +#define _SC_TZNAME_MAX 27 /* user */
1.215 +
1.216 +#if __POSIX_VISIBLE >= 199309
1.217 +#define _SC_ASYNCHRONOUS_IO 28
1.218 +#define _SC_MAPPED_FILES 29
1.219 +#define _SC_MEMLOCK 30
1.220 +#define _SC_MEMLOCK_RANGE 31
1.221 +#define _SC_MEMORY_PROTECTION 32
1.222 +#define _SC_MESSAGE_PASSING 33
1.223 +#define _SC_PRIORITIZED_IO 34
1.224 +#define _SC_PRIORITY_SCHEDULING 35
1.225 +#define _SC_REALTIME_SIGNALS 36
1.226 +#define _SC_SEMAPHORES 37
1.227 +#define _SC_FSYNC 38
1.228 +#define _SC_SHARED_MEMORY_OBJECTS 39
1.229 +#define _SC_SYNCHRONIZED_IO 40
1.230 +#define _SC_TIMERS 41
1.231 +#define _SC_AIO_LISTIO_MAX 42
1.232 +#define _SC_AIO_MAX 43
1.233 +#define _SC_AIO_PRIO_DELTA_MAX 44
1.234 +#define _SC_DELAYTIMER_MAX 45
1.235 +#define _SC_MQ_OPEN_MAX 46
1.236 +#define _SC_PAGESIZE 47
1.237 +#define _SC_RTSIG_MAX 48
1.238 +#define _SC_SEM_NSEMS_MAX 49
1.239 +#define _SC_SEM_VALUE_MAX 50
1.240 +#define _SC_SIGQUEUE_MAX 51
1.241 +#define _SC_TIMER_MAX 52
1.242 +#endif
1.243 +
1.244 +#if __POSIX_VISIBLE >= 200112
1.245 +#define _SC_2_PBS 59 /* user */
1.246 +#define _SC_2_PBS_ACCOUNTING 60 /* user */
1.247 +#define _SC_2_PBS_CHECKPOINT 61 /* user */
1.248 +#define _SC_2_PBS_LOCATE 62 /* user */
1.249 +#define _SC_2_PBS_MESSAGE 63 /* user */
1.250 +#define _SC_2_PBS_TRACK 64 /* user */
1.251 +#define _SC_ADVISORY_INFO 65
1.252 +#define _SC_BARRIERS 66 /* user */
1.253 +#define _SC_CLOCK_SELECTION 67
1.254 +#define _SC_CPUTIME 68
1.255 +#define _SC_FILE_LOCKING 69
1.256 +#define _SC_GETGR_R_SIZE_MAX 70 /* user */
1.257 +#define _SC_GETPW_R_SIZE_MAX 71 /* user */
1.258 +#define _SC_HOST_NAME_MAX 72
1.259 +#define _SC_LOGIN_NAME_MAX 73
1.260 +#define _SC_MONOTONIC_CLOCK 74
1.261 +#define _SC_MQ_PRIO_MAX 75
1.262 +#define _SC_READER_WRITER_LOCKS 76 /* user */
1.263 +#define _SC_REGEXP 77 /* user */
1.264 +#define _SC_SHELL 78 /* user */
1.265 +#define _SC_SPAWN 79 /* user */
1.266 +#define _SC_SPIN_LOCKS 80 /* user */
1.267 +#define _SC_SPORADIC_SERVER 81
1.268 +#define _SC_THREAD_ATTR_STACKADDR 82 /* user */
1.269 +#define _SC_THREAD_ATTR_STACKSIZE 83 /* user */
1.270 +#define _SC_THREAD_CPUTIME 84 /* user */
1.271 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
1.272 +#define _SC_THREAD_KEYS_MAX 86 /* user */
1.273 +#define _SC_THREAD_PRIO_INHERIT 87 /* user */
1.274 +#define _SC_THREAD_PRIO_PROTECT 88 /* user */
1.275 +#define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
1.276 +#define _SC_THREAD_PROCESS_SHARED 90 /* user */
1.277 +#define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */
1.278 +#define _SC_THREAD_SPORADIC_SERVER 92 /* user */
1.279 +#define _SC_THREAD_STACK_MIN 93 /* user */
1.280 +#define _SC_THREAD_THREADS_MAX 94 /* user */
1.281 +#define _SC_TIMEOUTS 95 /* user */
1.282 +#define _SC_THREADS 96 /* user */
1.283 +#define _SC_TRACE 97 /* user */
1.284 +#define _SC_TRACE_EVENT_FILTER 98 /* user */
1.285 +#define _SC_TRACE_INHERIT 99 /* user */
1.286 +#define _SC_TRACE_LOG 100 /* user */
1.287 +#define _SC_TTY_NAME_MAX 101 /* user */
1.288 +#define _SC_TYPED_MEMORY_OBJECTS 102
1.289 +#define _SC_V6_ILP32_OFF32 103 /* user */
1.290 +#define _SC_V6_ILP32_OFFBIG 104 /* user */
1.291 +#define _SC_V6_LP64_OFF64 105 /* user */
1.292 +#define _SC_V6_LPBIG_OFFBIG 106 /* user */
1.293 +#define _SC_IPV6 118
1.294 +#define _SC_RAW_SOCKETS 119
1.295 +#define _SC_SYMLOOP_MAX 120
1.296 +#endif
1.297 +
1.298 +#if __XSI_VISIBLE
1.299 +#define _SC_ATEXIT_MAX 107 /* user */
1.300 +#define _SC_IOV_MAX 56
1.301 +#define _SC_PAGE_SIZE _SC_PAGESIZE
1.302 +#define _SC_XOPEN_CRYPT 108 /* user */
1.303 +#define _SC_XOPEN_ENH_I18N 109 /* user */
1.304 +#define _SC_XOPEN_LEGACY 110 /* user */
1.305 +#define _SC_XOPEN_REALTIME 111
1.306 +#define _SC_XOPEN_REALTIME_THREADS 112
1.307 +#define _SC_XOPEN_SHM 113
1.308 +#define _SC_XOPEN_STREAMS 114
1.309 +#define _SC_XOPEN_UNIX 115
1.310 +#define _SC_XOPEN_VERSION 116
1.311 +#define _SC_XOPEN_XCU_VERSION 117 /* user */
1.312 +#endif
1.313 +
1.314 +#if __BSD_VISIBLE
1.315 +#define _SC_NPROCESSORS_CONF 57
1.316 +#define _SC_NPROCESSORS_ONLN 58
1.317 +#endif
1.318 +
1.319 +/* Keys for the confstr(3) function. */
1.320 +#if __POSIX_VISIBLE >= 199209
1.321 +#define _CS_PATH 1 /* default value of PATH */
1.322 +#endif
1.323 +
1.324 +#if __POSIX_VISIBLE >= 200112
1.325 +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
1.326 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
1.327 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
1.328 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
1.329 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
1.330 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
1.331 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
1.332 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
1.333 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
1.334 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
1.335 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
1.336 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
1.337 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
1.338 +#endif
1.339 +
1.340 +__BEGIN_DECLS
1.341 +/* 1003.1-1990 */
1.342 +IMPORT_C void _exit(int) __dead2;
1.343 +IMPORT_C int access(const char *, int);
1.344 +IMPORT_C int chdir(const char *);
1.345 +IMPORT_C int chown(const char *, uid_t, gid_t);
1.346 +IMPORT_C int close(int);
1.347 +IMPORT_C int dup(int);
1.348 +IMPORT_C int dup2(int, int);
1.349 +int eaccess(const char *, int);
1.350 +IMPORT_C long fpathconf(int, int);
1.351 +IMPORT_C char *getcwd(char *, size_t);
1.352 +IMPORT_C gid_t getegid(void);
1.353 +IMPORT_C uid_t geteuid(void);
1.354 +IMPORT_C gid_t getgid(void);
1.355 +IMPORT_C int getgroups(int, gid_t []);
1.356 +char *getlogin(void);
1.357 +IMPORT_C pid_t getpgrp(void);
1.358 +IMPORT_C pid_t getpid(void);
1.359 +IMPORT_C pid_t getppid(void);
1.360 +IMPORT_C uid_t getuid(void);
1.361 +IMPORT_C int isatty(int);
1.362 +IMPORT_C int link(const char *, const char *);
1.363 +#ifndef _LSEEK_DECLARED
1.364 +#define _LSEEK_DECLARED
1.365 +IMPORT_C off_t lseek(int, off_t, int);
1.366 +#endif
1.367 +IMPORT_C long pathconf(const char *, int);
1.368 +IMPORT_C int pipe(int *);
1.369 +IMPORT_C ssize_t read(int, void *, size_t);
1.370 +IMPORT_C int rmdir(const char *);
1.371 +IMPORT_C int setgid(gid_t);
1.372 +IMPORT_C int setpgid(pid_t, pid_t);
1.373 +void setproctitle(const char *_fmt, ...) __printf0like(1, 2);
1.374 +IMPORT_C pid_t setsid(void);
1.375 +IMPORT_C int setuid(uid_t);
1.376 +IMPORT_C unsigned int sleep(unsigned int);
1.377 +IMPORT_C
1.378 +long sysconf(int);
1.379 +IMPORT_C int unlink(const char *);
1.380 +IMPORT_C ssize_t write(int, const void *, size_t);
1.381 +/* 1003.2-1992 */
1.382 +#if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
1.383 +IMPORT_C size_t confstr(int, char *, size_t);
1.384 +#ifndef _GETOPT_DECLARED
1.385 +#define _GETOPT_DECLARED
1.386 +IMPORT_C int getopt(int, char * const [], const char *);
1.387 +
1.388 +#ifndef __SYMBIAN32__
1.389 +extern char *optarg; /* getopt(3) external variables */
1.390 +extern int optind, opterr, optopt;
1.391 +#else
1.392 +IMPORT_C int *__optopt(void);
1.393 +IMPORT_C int *__opterr(void);
1.394 +IMPORT_C int *__optind(void);
1.395 +IMPORT_C char **__optarg(void);
1.396 +#define optopt (*__optopt())
1.397 +#define opterr (*__opterr())
1.398 +#define optind (*__optind())
1.399 +#define optarg (*__optarg())
1.400 +#endif /* __SYMBIAN32__ */
1.401 +
1.402 +#endif /* _GETOPT_DECLARED */
1.403 +#endif
1.404 +
1.405 +/* ISO/IEC 9945-1: 1996 */
1.406 +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
1.407 +IMPORT_C int fsync(int);
1.408 +IMPORT_C int fdatasync(int);
1.409 +/*
1.410 + * ftruncate() was in the POSIX Realtime Extension (it's used for shared
1.411 + * memory), but truncate() was not.
1.412 + */
1.413 +#ifndef _FTRUNCATE_DECLARED
1.414 +#define _FTRUNCATE_DECLARED
1.415 +IMPORT_C int ftruncate(int, off_t);
1.416 +#endif
1.417 +#endif
1.418 +
1.419 +#if __POSIX_VISIBLE >= 199506
1.420 +
1.421 +#ifndef __SYMBIAN32__
1.422 +int getlogin_r(char *, int);
1.423 +#endif //__SYMBIAN32__
1.424 +
1.425 +#endif
1.426 +
1.427 +/* 1003.1-2001 */
1.428 +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
1.429 +IMPORT_C int readlink(const char *, char *, int);
1.430 +#endif
1.431 +#if __POSIX_VISIBLE >= 200112
1.432 +IMPORT_C int gethostname(char *, size_t);
1.433 +IMPORT_C int setegid(gid_t);
1.434 +IMPORT_C int seteuid(uid_t);
1.435 +#endif
1.436 +
1.437 +/*
1.438 + * symlink() was originally in POSIX.1a, which was withdrawn after
1.439 + * being overtaken by events (1003.1-2001). It was in XPG4.2, and of
1.440 + * course has been in BSD since 4.2.
1.441 + */
1.442 +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE
1.443 +IMPORT_C int symlink(const char * __restrict, const char * __restrict);
1.444 +#endif
1.445 +
1.446 +/* X/Open System Interfaces */
1.447 +#if __XSI_VISIBLE
1.448 +char *crypt(const char *, const char *);
1.449 +/* char *ctermid(char *); */ /* XXX ??? */
1.450 +int encrypt(char *, int);
1.451 +IMPORT_C int fchdir(int);
1.452 +IMPORT_C int getpgid(pid_t _pid);
1.453 +IMPORT_C int lchown(const char *, uid_t, gid_t);
1.454 +IMPORT_C int nice(int);
1.455 +IMPORT_C int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */
1.456 +IMPORT_C int setregid(gid_t, gid_t);
1.457 +IMPORT_C int setreuid(uid_t, uid_t);
1.458 +
1.459 +#ifndef _SWAB_DECLARED
1.460 +#define _SWAB_DECLARED
1.461 +IMPORT_C
1.462 +void swab(const void * __restrict, void * __restrict, ssize_t);
1.463 +#endif /* _SWAB_DECLARED */
1.464 +
1.465 +void sync(void);
1.466 +IMPORT_C int usleep(useconds_t);
1.467 +
1.468 +/* See comment at ftruncate() above. */
1.469 +#ifndef _TRUNCATE_DECLARED
1.470 +#define _TRUNCATE_DECLARED
1.471 +IMPORT_C int truncate(const char *, off_t);
1.472 +#endif
1.473 +#endif /* __XSI_VISIBLE */
1.474 +
1.475 +#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
1.476 +IMPORT_C int brk(const void *);
1.477 +IMPORT_C int getdtablesize(void);
1.478 +IMPORT_C int getpagesize(void) __pure2;
1.479 +#endif
1.480 +
1.481 +#if __BSD_VISIBLE
1.482 +struct timeval; /* select(2) */
1.483 +IMPORT_C int initgroups(const char *, gid_t);
1.484 +IMPORT_C int issetugid(void);
1.485 +
1.486 +#ifdef __SYMBIAN_COMPILE_UNUSED__
1.487 +char *mkdtemp(char *);
1.488 +#endif
1.489 +
1.490 +#ifndef _MKNOD_DECLARED
1.491 +int mknod(const char *, mode_t, dev_t);
1.492 +#define _MKNOD_DECLARED
1.493 +#endif
1.494 +#ifndef _MKSTEMP_DECLARED
1.495 +IMPORT_C int mkstemp(char *);
1.496 +#define _MKSTEMP_DECLARED
1.497 +#endif
1.498 +
1.499 +#ifdef __SYMBIAN_COMPILE_UNUSED__
1.500 +int mkstemps(char *, int);
1.501 +#endif
1.502 +
1.503 +#ifndef _MKTEMP_DECLARED
1.504 +
1.505 +#ifdef __SYMBIAN_COMPILE_UNUSED__
1.506 +char *mktemp(char *);
1.507 +#endif
1.508 +
1.509 +#define _MKTEMP_DECLARED
1.510 +#endif
1.511 +int nfssvc(int, void *);
1.512 +
1.513 +#if __BSD_VISIBLE
1.514 +#ifndef __SYMBIAN32__
1.515 +#ifndef _SELECT_DECLARED
1.516 +#define _SELECT_DECLARED
1.517 +IMPORT_C int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
1.518 +#endif // _SELECT_DECLARED
1.519 +#endif // __SYMBIAN32__
1.520 +#endif // __BSD_VISIBLE
1.521 +
1.522 +IMPORT_C int setgroups(int, const gid_t *);
1.523 +#ifndef _SETKEY_DECLARED
1.524 +int setkey(const char *);
1.525 +#define _SETKEY_DECLARED
1.526 +#endif
1.527 +
1.528 +#ifndef _OPTRESET_DECLARED
1.529 +#define _OPTRESET_DECLARED
1.530 +#ifndef __SYMBIAN32__
1.531 +extern int optreset; /* getopt(3) external variable */
1.532 +#else
1.533 +IMPORT_C int *__optreset(void);
1.534 +#define optreset (*__optreset())
1.535 +#endif /* __SYMBIAN32__ */
1.536 +
1.537 +#ifdef __SYMBIAN32__
1.538 +#ifndef __XSI_VISIBLE
1.539 +void encrypt(char block[], int edflag);
1.540 +char *crypt(const char *key, const char *salt);
1.541 +#endif /* ifdef __SYMBIAN32__ */
1.542 +#endif /* ifndef __XSI_VISIBLE */
1.543 +
1.544 +#endif /* _OPTRESET_DECLARED */
1.545 +#endif /* __BSD_VISIBLE */
1.546 +__END_DECLS
1.547 +
1.548 +//---
1.549 +#ifdef __cplusplus
1.550 +}
1.551 +#endif
1.552 +//---
1.553 +
1.554 +#endif /* !_UNISTD_H_ */