epoc32/include/stdapis/unistd.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /*-
     2  * © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     3  * © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
     4  * Copyright (c) 1991, 1993, 1994
     5  *	The Regents of the University of California.  All rights reserved.
     6  *
     7  * Redistribution and use in source and binary forms, with or without
     8  * modification, are permitted provided that the following conditions
     9  * are met:
    10  * 1. Redistributions of source code must retain the above copyright
    11  *    notice, this list of conditions and the following disclaimer.
    12  * 2. Redistributions in binary form must reproduce the above copyright
    13  *    notice, this list of conditions and the following disclaimer in the
    14  *    documentation and/or other materials provided with the distribution.
    15  * 4. Neither the name of the University nor the names of its contributors
    16  *    may be used to endorse or promote products derived from this software
    17  *    without specific prior written permission.
    18  *
    19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    29  * SUCH DAMAGE.
    30  * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
    31  *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
    32  * $FreeBSD: src/include/unistd.h,v 1.78 2005/05/13 16:27:30 delphij Exp $
    33  */
    34 
    35 #ifndef _UNISTD_H_
    36 #define	_UNISTD_H_
    37 
    38 //---
    39 #ifdef __cplusplus
    40 #include <e32def.h>
    41 
    42 extern "C" {
    43 #endif
    44 
    45 //---
    46 
    47 #include <sys/cdefs.h>
    48 #include <sys/types.h>			/* XXX adds too much pollution. */
    49 #include <sys/unistd.h>
    50 #include <sys/_null.h>
    51 #include <sys/_types.h>
    52 
    53 #ifdef __SYMBIAN32__
    54 #include <_ansi.h>
    55 #endif //__SYMBIAN32__
    56 
    57 #ifdef __SYMBIAN32__
    58 __BEGIN_DECLS
    59 IMPORT_C char ***__environ(void);
    60 __END_DECLS
    61 #define environ	  (*__environ())
    62 #endif //__SYMBIAN32__
    63 
    64 #ifndef _GID_T_DECLARED
    65 typedef	__gid_t		gid_t;
    66 #define	_GID_T_DECLARED
    67 #endif
    68 
    69 #ifndef _OFF_T_DECLARED
    70 typedef	__off_t		off_t;
    71 #define	_OFF_T_DECLARED
    72 #endif
    73 
    74 #ifndef _PID_T_DECLARED
    75 typedef	__pid_t		pid_t;
    76 #define	_PID_T_DECLARED
    77 #endif
    78 
    79 #ifndef _SIZE_T_DECLARED
    80 typedef	__size_t	size_t;
    81 #define	_SIZE_T_DECLARED
    82 #endif
    83 
    84 #ifndef _SSIZE_T_DECLARED
    85 typedef	__ssize_t	ssize_t;
    86 #define	_SSIZE_T_DECLARED
    87 #endif
    88 
    89 #ifndef _UID_T_DECLARED
    90 typedef	__uid_t		uid_t;
    91 #define	_UID_T_DECLARED
    92 #endif
    93 
    94 #ifndef _USECONDS_T_DECLARED
    95 typedef	__useconds_t	useconds_t;
    96 #define	_USECONDS_T_DECLARED
    97 #endif
    98 
    99 #define	 STDIN_FILENO	0	/* standard input file descriptor */
   100 #define	STDOUT_FILENO	1	/* standard output file descriptor */
   101 #define	STDERR_FILENO	2	/* standard error file descriptor */
   102 
   103 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
   104 #define	F_ULOCK		0	/* unlock locked section */
   105 #define	F_LOCK		1	/* lock a section for exclusive use */
   106 #define	F_TLOCK		2	/* test and lock a section for exclusive use */
   107 #define	F_TEST		3	/* test a section for locks by other procs */
   108 #endif
   109 
   110 /*
   111  * POSIX options and option groups we unconditionally do or don't
   112  * implement.  This list includes those options which are exclusively
   113  * implemented (or not) in user mode.  Please keep this list in
   114  * alphabetical order.
   115  *
   116  * Anything which is defined as zero below **must** have an
   117  * implementation for the corresponding sysconf() which is able to
   118  * determine conclusively whether or not the feature is supported.
   119  * Anything which is defined as other than -1 below **must** have
   120  * complete headers, types, and function declarations as specified by
   121  * the POSIX standard; however, if the relevant sysconf() function
   122  * returns -1, the functions may be stubbed out.
   123  */
   124 #define	_POSIX_BARRIERS			-1
   125 #define	_POSIX_READER_WRITER_LOCKS -1	
   126 #define	_POSIX_REGEXP			1
   127 #define	_POSIX_SHELL			1
   128 #define	_POSIX_SPAWN			-1
   129 #define	_POSIX_SPIN_LOCKS		-1
   130 #define	_POSIX_THREAD_ATTR_STACKADDR -1	
   131 #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L
   132 #define	_POSIX_THREAD_CPUTIME		-1
   133 #define	_POSIX_THREAD_PRIO_INHERIT -1	
   134 #define	_POSIX_THREAD_PRIO_PROTECT -1	
   135 #define	_POSIX_THREAD_PRIORITY_SCHEDULING 200112L
   136 #define	_POSIX_THREAD_PROCESS_SHARED	-1
   137 #define	_POSIX_THREAD_SAFE_FUNCTIONS	200112L
   138 #define	_POSIX_THREAD_SPORADIC_SERVER	-1
   139 #define	_POSIX_THREADS			200112L
   140 #define	_POSIX_TRACE			-1
   141 #define	_POSIX_TRACE_EVENT_FILTER	-1
   142 #define	_POSIX_TRACE_INHERIT		-1
   143 #define	_POSIX_TRACE_LOG		-1
   144 #define	_POSIX2_C_BIND			200112L	/* mandatory */
   145 #define	_POSIX2_C_DEV			-1 /* need c99 utility */
   146 #define	_POSIX2_CHAR_TERM		1
   147 #define	_POSIX2_FORT_DEV		-1 /* need fort77 utility */
   148 #define	_POSIX2_FORT_RUN		200112L
   149 #define	_POSIX2_LOCALEDEF		-1
   150 #define	_POSIX2_PBS			-1
   151 #define	_POSIX2_PBS_ACCOUNTING		-1
   152 #define	_POSIX2_PBS_CHECKPOINT		-1
   153 #define	_POSIX2_PBS_LOCATE		-1
   154 #define	_POSIX2_PBS_MESSAGE		-1
   155 #define	_POSIX2_PBS_TRACK		-1
   156 #define	_POSIX2_SW_DEV			-1 /* XXX ??? */
   157 #define	_POSIX2_UPE			200112L
   158 #define	_V6_ILP32_OFF32			-1
   159 #define	_V6_ILP32_OFFBIG		0
   160 #define	_V6_LP64_OFF64			0
   161 #define	_V6_LPBIG_OFFBIG		-1
   162 
   163 #if __XSI_VISIBLE
   164 #define	_XOPEN_CRYPT			-1 /* XXX ??? */
   165 #define	_XOPEN_ENH_I18N			-1 /* mandatory in XSI */
   166 #define	_XOPEN_LEGACY			-1
   167 #define	_XOPEN_REALTIME			-1
   168 #define	_XOPEN_REALTIME_THREADS		-1
   169 #define	_XOPEN_UNIX			-1
   170 #endif
   171 
   172 /* Define the POSIX.2 version we target for compliance. */
   173 #define	_POSIX2_VERSION		199212L
   174 
   175 /*
   176  * POSIX-style system configuration variable accessors (for the
   177  * sysconf function).  The kernel does not directly implement the
   178  * sysconf() interface; rather, a C library stub translates references
   179  * to sysconf() into calls to sysctl() using a giant switch statement.
   180  * Those that are marked `user' are implemented entirely in the C
   181  * library and never query the kernel.  pathconf() is implemented
   182  * directly by the kernel so those are not defined here.
   183  */
   184 #define	_SC_ARG_MAX		 1
   185 #define	_SC_CHILD_MAX		 2
   186 #define	_SC_CLK_TCK		 3
   187 #define	_SC_NGROUPS_MAX		 4
   188 #define	_SC_OPEN_MAX		 5
   189 #define	_SC_JOB_CONTROL		 6
   190 #define	_SC_SAVED_IDS		 7
   191 #define	_SC_VERSION		 8
   192 #define	_SC_BC_BASE_MAX		 9 /* user */
   193 #define	_SC_BC_DIM_MAX		10 /* user */
   194 #define	_SC_BC_SCALE_MAX	11 /* user */
   195 #define	_SC_BC_STRING_MAX	12 /* user */
   196 #define	_SC_COLL_WEIGHTS_MAX	13 /* user */
   197 #define	_SC_EXPR_NEST_MAX	14 /* user */
   198 #define	_SC_LINE_MAX		15 /* user */
   199 #define	_SC_RE_DUP_MAX		16 /* user */
   200 #define	_SC_2_VERSION		17 /* user */
   201 #define	_SC_2_C_BIND		18 /* user */
   202 #define	_SC_2_C_DEV		19 /* user */
   203 #define	_SC_2_CHAR_TERM		20 /* user */
   204 #define	_SC_2_FORT_DEV		21 /* user */
   205 #define	_SC_2_FORT_RUN		22 /* user */
   206 #define	_SC_2_LOCALEDEF		23 /* user */
   207 #define	_SC_2_SW_DEV		24 /* user */
   208 #define	_SC_2_UPE		25 /* user */
   209 #define	_SC_STREAM_MAX		26 /* user */
   210 #define	_SC_TZNAME_MAX		27 /* user */
   211 
   212 #if __POSIX_VISIBLE >= 199309
   213 #define	_SC_ASYNCHRONOUS_IO	28
   214 #define	_SC_MAPPED_FILES	29
   215 #define	_SC_MEMLOCK		30
   216 #define	_SC_MEMLOCK_RANGE	31
   217 #define	_SC_MEMORY_PROTECTION	32
   218 #define	_SC_MESSAGE_PASSING	33
   219 #define	_SC_PRIORITIZED_IO	34
   220 #define	_SC_PRIORITY_SCHEDULING	35
   221 #define	_SC_REALTIME_SIGNALS	36
   222 #define	_SC_SEMAPHORES		37
   223 #define	_SC_FSYNC		38
   224 #define	_SC_SHARED_MEMORY_OBJECTS 39
   225 #define	_SC_SYNCHRONIZED_IO	40
   226 #define	_SC_TIMERS		41
   227 #define	_SC_AIO_LISTIO_MAX	42
   228 #define	_SC_AIO_MAX		43
   229 #define	_SC_AIO_PRIO_DELTA_MAX	44
   230 #define	_SC_DELAYTIMER_MAX	45
   231 #define	_SC_MQ_OPEN_MAX		46
   232 #define	_SC_PAGESIZE		47
   233 #define	_SC_RTSIG_MAX		48
   234 #define	_SC_SEM_NSEMS_MAX	49
   235 #define	_SC_SEM_VALUE_MAX	50
   236 #define	_SC_SIGQUEUE_MAX	51
   237 #define	_SC_TIMER_MAX		52
   238 #endif
   239 
   240 #if __POSIX_VISIBLE >= 200112
   241 #define	_SC_2_PBS		59 /* user */
   242 #define	_SC_2_PBS_ACCOUNTING	60 /* user */
   243 #define	_SC_2_PBS_CHECKPOINT	61 /* user */
   244 #define	_SC_2_PBS_LOCATE	62 /* user */
   245 #define	_SC_2_PBS_MESSAGE	63 /* user */
   246 #define	_SC_2_PBS_TRACK		64 /* user */
   247 #define	_SC_ADVISORY_INFO	65
   248 #define	_SC_BARRIERS		66 /* user */
   249 #define	_SC_CLOCK_SELECTION	67
   250 #define	_SC_CPUTIME		68
   251 #define	_SC_FILE_LOCKING	69
   252 #define	_SC_GETGR_R_SIZE_MAX	70 /* user */
   253 #define	_SC_GETPW_R_SIZE_MAX	71 /* user */
   254 #define	_SC_HOST_NAME_MAX	72
   255 #define	_SC_LOGIN_NAME_MAX	73
   256 #define	_SC_MONOTONIC_CLOCK	74
   257 #define	_SC_MQ_PRIO_MAX		75
   258 #define	_SC_READER_WRITER_LOCKS	76 /* user */
   259 #define	_SC_REGEXP		77 /* user */
   260 #define	_SC_SHELL		78 /* user */
   261 #define	_SC_SPAWN		79 /* user */
   262 #define	_SC_SPIN_LOCKS		80 /* user */
   263 #define	_SC_SPORADIC_SERVER	81
   264 #define	_SC_THREAD_ATTR_STACKADDR 82 /* user */
   265 #define	_SC_THREAD_ATTR_STACKSIZE 83 /* user */
   266 #define	_SC_THREAD_CPUTIME	84 /* user */
   267 #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
   268 #define	_SC_THREAD_KEYS_MAX	86 /* user */
   269 #define	_SC_THREAD_PRIO_INHERIT	87 /* user */
   270 #define	_SC_THREAD_PRIO_PROTECT	88 /* user */
   271 #define	_SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
   272 #define	_SC_THREAD_PROCESS_SHARED 90 /* user */
   273 #define	_SC_THREAD_SAFE_FUNCTIONS 91 /* user */
   274 #define	_SC_THREAD_SPORADIC_SERVER 92 /* user */
   275 #define	_SC_THREAD_STACK_MIN	93 /* user */
   276 #define	_SC_THREAD_THREADS_MAX	94 /* user */
   277 #define	_SC_TIMEOUTS		95 /* user */
   278 #define	_SC_THREADS		96 /* user */
   279 #define	_SC_TRACE		97 /* user */
   280 #define	_SC_TRACE_EVENT_FILTER	98 /* user */
   281 #define	_SC_TRACE_INHERIT	99 /* user */
   282 #define	_SC_TRACE_LOG		100 /* user */
   283 #define	_SC_TTY_NAME_MAX	101 /* user */
   284 #define	_SC_TYPED_MEMORY_OBJECTS 102
   285 #define	_SC_V6_ILP32_OFF32	103 /* user */
   286 #define	_SC_V6_ILP32_OFFBIG	104 /* user */
   287 #define	_SC_V6_LP64_OFF64	105 /* user */
   288 #define	_SC_V6_LPBIG_OFFBIG	106 /* user */
   289 #define	_SC_IPV6		118
   290 #define	_SC_RAW_SOCKETS		119
   291 #define	_SC_SYMLOOP_MAX		120
   292 #endif
   293 
   294 #if __XSI_VISIBLE
   295 #define	_SC_ATEXIT_MAX		107 /* user */
   296 #define	_SC_IOV_MAX		56
   297 #define	_SC_PAGE_SIZE		_SC_PAGESIZE
   298 #define	_SC_XOPEN_CRYPT		108 /* user */
   299 #define	_SC_XOPEN_ENH_I18N	109 /* user */
   300 #define	_SC_XOPEN_LEGACY	110 /* user */
   301 #define	_SC_XOPEN_REALTIME	111
   302 #define	_SC_XOPEN_REALTIME_THREADS 112
   303 #define	_SC_XOPEN_SHM		113
   304 #define	_SC_XOPEN_STREAMS	114
   305 #define	_SC_XOPEN_UNIX		115
   306 #define	_SC_XOPEN_VERSION	116
   307 #define	_SC_XOPEN_XCU_VERSION	117 /* user */
   308 #endif
   309 
   310 #if __BSD_VISIBLE
   311 #define	_SC_NPROCESSORS_CONF	57
   312 #define	_SC_NPROCESSORS_ONLN	58
   313 #endif
   314 
   315 /* Keys for the confstr(3) function. */
   316 #if __POSIX_VISIBLE >= 199209
   317 #define	_CS_PATH		1	/* default value of PATH */
   318 #endif
   319 
   320 #if __POSIX_VISIBLE >= 200112
   321 #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2
   322 #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3
   323 #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4
   324 #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5
   325 #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6
   326 #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7
   327 #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8
   328 #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9
   329 #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10
   330 #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11
   331 #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12
   332 #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13
   333 #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14
   334 #endif
   335 
   336 __BEGIN_DECLS
   337 /* 1003.1-1990 */
   338 IMPORT_C void	 _exit(int) __dead2;
   339 IMPORT_C int	 access(const char *, int);
   340 IMPORT_C int	 chdir(const char *);
   341 IMPORT_C int	 chown(const char *, uid_t, gid_t);
   342 IMPORT_C int	 close(int);
   343 IMPORT_C int	 dup(int);
   344 IMPORT_C int	 dup2(int, int);
   345 int	 eaccess(const char *, int);
   346 IMPORT_C long	 fpathconf(int, int);
   347 IMPORT_C char	*getcwd(char *, size_t);
   348 IMPORT_C gid_t	 getegid(void);
   349 IMPORT_C uid_t	 geteuid(void);
   350 IMPORT_C gid_t	 getgid(void);
   351 IMPORT_C int	 getgroups(int, gid_t []);
   352 char	*getlogin(void);
   353 IMPORT_C pid_t	 getpgrp(void);
   354 IMPORT_C pid_t	 getpid(void);
   355 IMPORT_C pid_t	 getppid(void);
   356 IMPORT_C uid_t	 getuid(void);
   357 IMPORT_C int	 isatty(int);
   358 IMPORT_C int	 link(const char *, const char *);
   359 #ifndef _LSEEK_DECLARED
   360 #define	_LSEEK_DECLARED
   361 IMPORT_C off_t	 lseek(int, off_t, int);
   362 #endif
   363 IMPORT_C long	 pathconf(const char *, int);
   364 IMPORT_C int pipe(int *);
   365 IMPORT_C ssize_t	 read(int, void *, size_t);
   366 IMPORT_C int	 rmdir(const char *);
   367 IMPORT_C int	 setgid(gid_t);
   368 IMPORT_C int	 setpgid(pid_t, pid_t);
   369 void	 setproctitle(const char *_fmt, ...) __printf0like(1, 2);
   370 IMPORT_C pid_t	 setsid(void);
   371 IMPORT_C int	 setuid(uid_t);
   372 IMPORT_C unsigned int	 sleep(unsigned int);
   373 IMPORT_C 
   374 long	 sysconf(int);
   375 IMPORT_C int	 unlink(const char *);
   376 IMPORT_C ssize_t	 write(int, const void *, size_t);
   377 /* 1003.2-1992 */
   378 #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
   379 IMPORT_C size_t	 confstr(int, char *, size_t);
   380 #ifndef _GETOPT_DECLARED
   381 #define	_GETOPT_DECLARED
   382 IMPORT_C int	 getopt(int, char * const [], const char *);
   383 
   384 #ifndef __SYMBIAN32__
   385 extern char *optarg;			/* getopt(3) external variables */
   386 extern int optind, opterr, optopt;
   387 #else
   388 IMPORT_C int *__optopt(void);
   389 IMPORT_C int *__opterr(void);
   390 IMPORT_C int *__optind(void);
   391 IMPORT_C char **__optarg(void);
   392 #define optopt	  (*__optopt())
   393 #define opterr	  (*__opterr())
   394 #define optind	  (*__optind())
   395 #define optarg	  (*__optarg())
   396 #endif /* __SYMBIAN32__ */
   397 
   398 #endif /* _GETOPT_DECLARED */
   399 #endif
   400 
   401 /* ISO/IEC 9945-1: 1996 */
   402 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
   403 IMPORT_C int	 fsync(int);
   404 IMPORT_C int fdatasync(int);
   405 /*
   406  * ftruncate() was in the POSIX Realtime Extension (it's used for shared
   407  * memory), but truncate() was not.
   408  */
   409 #ifndef _FTRUNCATE_DECLARED
   410 #define	_FTRUNCATE_DECLARED
   411 IMPORT_C int	 ftruncate(int, off_t);
   412 #endif
   413 #endif
   414 
   415 #if __POSIX_VISIBLE >= 199506
   416 
   417 #ifndef __SYMBIAN32__
   418 int	 getlogin_r(char *, int);
   419 #endif //__SYMBIAN32__
   420 
   421 #endif
   422 
   423 /* 1003.1-2001 */
   424 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
   425 IMPORT_C int	 readlink(const char *, char *, int);
   426 #endif
   427 #if __POSIX_VISIBLE >= 200112
   428 IMPORT_C int	 gethostname(char *, size_t);
   429 IMPORT_C int	 setegid(gid_t);
   430 IMPORT_C int	 seteuid(uid_t);
   431 #endif
   432 
   433 /*
   434  * symlink() was originally in POSIX.1a, which was withdrawn after
   435  * being overtaken by events (1003.1-2001).  It was in XPG4.2, and of
   436  * course has been in BSD since 4.2.
   437  */
   438 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE
   439 IMPORT_C int	 symlink(const char * __restrict, const char * __restrict);
   440 #endif
   441 
   442 /* X/Open System Interfaces */
   443 #if __XSI_VISIBLE
   444 char	*crypt(const char *, const char *);
   445 /* char	*ctermid(char *); */		/* XXX ??? */
   446 int	 encrypt(char *, int);
   447 IMPORT_C int	 fchdir(int);
   448 IMPORT_C int	 getpgid(pid_t _pid);
   449 IMPORT_C int	 lchown(const char *, uid_t, gid_t);
   450 IMPORT_C int	 nice(int);
   451 IMPORT_C int	 setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */
   452 IMPORT_C int	 setregid(gid_t, gid_t);
   453 IMPORT_C int	 setreuid(uid_t, uid_t);
   454 
   455 #ifndef _SWAB_DECLARED
   456 #define _SWAB_DECLARED
   457 IMPORT_C 
   458 void	 swab(const void * __restrict, void * __restrict, ssize_t);
   459 #endif /* _SWAB_DECLARED */
   460 
   461 void	 sync(void);
   462 IMPORT_C int	 usleep(useconds_t);
   463 
   464 /* See comment at ftruncate() above. */
   465 #ifndef _TRUNCATE_DECLARED
   466 #define	_TRUNCATE_DECLARED
   467 IMPORT_C int	 truncate(const char *, off_t);
   468 #endif
   469 #endif /* __XSI_VISIBLE */
   470 
   471 #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
   472 IMPORT_C int	 brk(const void *);
   473 IMPORT_C int	 getdtablesize(void);
   474 IMPORT_C int	 getpagesize(void) __pure2;
   475 #endif
   476 
   477 #if __BSD_VISIBLE
   478 struct timeval;				/* select(2) */
   479 IMPORT_C int	 initgroups(const char *, gid_t);
   480 IMPORT_C int	 issetugid(void);
   481 
   482 #ifdef __SYMBIAN_COMPILE_UNUSED__
   483 char	*mkdtemp(char *);
   484 #endif
   485 
   486 #ifndef	_MKNOD_DECLARED
   487 int	 mknod(const char *, mode_t, dev_t);
   488 #define	_MKNOD_DECLARED
   489 #endif
   490 #ifndef _MKSTEMP_DECLARED
   491 IMPORT_C int	 mkstemp(char *);
   492 #define	_MKSTEMP_DECLARED
   493 #endif
   494 
   495 #ifdef __SYMBIAN_COMPILE_UNUSED__
   496 int	 mkstemps(char *, int);
   497 #endif
   498 
   499 #ifndef _MKTEMP_DECLARED
   500 
   501 #ifdef __SYMBIAN_COMPILE_UNUSED__
   502 char	*mktemp(char *);
   503 #endif
   504 
   505 #define	_MKTEMP_DECLARED
   506 #endif
   507 int	 nfssvc(int, void *);
   508 
   509 #if __BSD_VISIBLE
   510 #ifndef __SYMBIAN32__
   511 #ifndef _SELECT_DECLARED
   512 #define	_SELECT_DECLARED
   513 IMPORT_C int	 select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
   514 #endif // _SELECT_DECLARED
   515 #endif // __SYMBIAN32__
   516 #endif // __BSD_VISIBLE
   517 
   518 IMPORT_C int	 setgroups(int, const gid_t *);
   519 #ifndef _SETKEY_DECLARED
   520 int	 setkey(const char *);
   521 #define	_SETKEY_DECLARED
   522 #endif
   523 
   524 #ifndef _OPTRESET_DECLARED
   525 #define	_OPTRESET_DECLARED
   526 #ifndef __SYMBIAN32__
   527 extern int optreset;			/* getopt(3) external variable */
   528 #else
   529 IMPORT_C int *__optreset(void);
   530 #define optreset  (*__optreset())
   531 #endif /* __SYMBIAN32__ */
   532 
   533 #ifdef __SYMBIAN32__
   534 #ifndef __XSI_VISIBLE
   535 void encrypt(char block[], int edflag);
   536 char *crypt(const char *key, const char *salt);
   537 #endif /* ifdef __SYMBIAN32__ */
   538 #endif /* ifndef __XSI_VISIBLE */
   539 
   540 #endif /* _OPTRESET_DECLARED */
   541 #endif /* __BSD_VISIBLE */
   542 __END_DECLS
   543 
   544 //---
   545 #ifdef __cplusplus
   546 }
   547 #endif
   548 //---
   549 
   550 #endif /* !_UNISTD_H_ */