genericopenlibs/cstdlib/LINCSYS/UNISTD.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @PublishedAll
       
    23 */
       
    24 
       
    25 #ifndef _SYS_UNISTD_H
       
    26 #define _SYS_UNISTD_H
       
    27 #ifdef __cplusplus
       
    28 extern "C" {
       
    29 #endif
       
    30 #include <_ansi.h>
       
    31 #include <sys/types.h>
       
    32 #define __need_size_t
       
    33 #include <stddef.h>
       
    34 
       
    35 IMPORT_C int	access		(const char *_path, int _amode );
       
    36 IMPORT_C int	waccess		(const wchar_t *_path, int _amode );
       
    37 IMPORT_C int    chdir		(const char *_path );
       
    38 IMPORT_C int    wchdir		(const wchar_t *_path );
       
    39 IMPORT_C int    chmod		(const char *_path, mode_t _mode );
       
    40 IMPORT_C int    wchmod		(const wchar_t *_path, mode_t _mode );
       
    41 IMPORT_C int    close		(int _fildes );
       
    42 IMPORT_C int    dup		(int _fildes );
       
    43 IMPORT_C int    dup2		(int _fildes, int _fildes2 );
       
    44 IMPORT_C int    fsync		(int _fildes );
       
    45 IMPORT_C char*	getcwd		(char *_buf, size_t _size );
       
    46 IMPORT_C wchar_t*	wgetcwd		(wchar_t *_buf, size_t _size );
       
    47 IMPORT_C int	gethostname	(char *_buf, size_t _size );
       
    48 IMPORT_C int    isatty		(int _fildes );
       
    49 IMPORT_C off_t  lseek		(int _fildes, off_t _offset, int _whence );
       
    50 IMPORT_C int	open		(const char *, int, ...);
       
    51 IMPORT_C int	wopen		(const wchar_t *, int, ...);
       
    52 IMPORT_C int    read		(int _fildes, char *_buf, size_t _nbyte );
       
    53 IMPORT_C int	rename		(const char *, const char *);
       
    54 IMPORT_C int	wrename		(const wchar_t *, const wchar_t *);
       
    55 IMPORT_C int    rmdir		(const char *_path );
       
    56 IMPORT_C int    wrmdir		(const wchar_t *_path );
       
    57 IMPORT_C int    unlink		(const char *_path );
       
    58 IMPORT_C int    wunlink		(const wchar_t *_path );
       
    59 IMPORT_C int    write		(int _fildes, const char *_buf, size_t _nbyte );
       
    60 IMPORT_C void	_exit		(int _status ) _ATTRIBUTE((noreturn));
       
    61 
       
    62 /** 
       
    63 NB. open is also declared in fcntl.h 
       
    64 @publishedAll
       
    65 @released
       
    66 */
       
    67 IMPORT_C pid_t   getpid		(void );
       
    68 /**
       
    69 @publishedAll
       
    70 @released
       
    71 */
       
    72 IMPORT_C unsigned sleep		(unsigned int _seconds );
       
    73 
       
    74 #define remove(x)       unlink(x)
       
    75 #define wremove(x)       wunlink(x)
       
    76 
       
    77 unsigned  alarm		(unsigned _secs );
       
    78 int     chown		(const char *_path, uid_t _owner, gid_t _group );
       
    79 char    *ctermid	(char *_s );
       
    80 char    *cuserid	(char *_s );
       
    81 int     execl		(const char *_path, const char *, ... );
       
    82 int     execle		(const char *_path, const char *, ... );
       
    83 int     execlp		(const char *_file, const char *, ... );
       
    84 int     execv		(const char *_path, char * const _argv[] );
       
    85 int     execve		(const char *_path, char * const _argv[], char * const _envp[] );
       
    86 int     execvp		(const char *_file, char * const _argv[] );
       
    87 pid_t   fork		(void );
       
    88 long    fpathconf	(int _fd, int _name );
       
    89 gid_t   getegid		(void );
       
    90 uid_t   geteuid		(void );
       
    91 gid_t   getgid		(void );
       
    92 int     getgroups	(int _gidsetsize, gid_t _grouplist[] );
       
    93 char    *getlogin	(void );
       
    94 size_t  getpagesize	(void);
       
    95 pid_t   getpgrp		(void );
       
    96 pid_t   getppid		(void );
       
    97 uid_t   getuid		(void );
       
    98 int     link		(const char *_path1, const char *_path2 );
       
    99 long    pathconf	(char *_path, int _name );
       
   100 int     pause		(void );
       
   101 int     pipe		(int _fildes[2] );
       
   102 void *  sbrk		(size_t incr);
       
   103 int     setgid		(gid_t _gid );
       
   104 int     setpgid		(pid_t _pid, pid_t _pgid );
       
   105 pid_t   setsid		(void );
       
   106 int     setuid		(uid_t _uid );
       
   107 long    sysconf		(int _name );
       
   108 pid_t   tcgetpgrp	(int _fildes );
       
   109 int     tcsetpgrp	(int _fildes, pid_t _pgrp_id );
       
   110 char    *ttyname	(int _fildes );
       
   111 
       
   112 long	sysconf		(int _name);
       
   113 
       
   114 # define	_SC_ARG_MAX	0
       
   115 # define	_SC_CHILD_MAX	1
       
   116 # define	_SC_CLK_TCK	2
       
   117 # define	_SC_NGROUPS_MAX	3
       
   118 # define	_SC_OPEN_MAX	4
       
   119 /* no _SC_STREAM_MAX */
       
   120 # define	_SC_JOB_CONTROL	5
       
   121 # define	_SC_SAVED_IDS	6
       
   122 # define	_SC_VERSION	7
       
   123 # define        _SC_PAGESIZE    8
       
   124 # define	_PC_LINK_MAX	0
       
   125 # define	_PC_MAX_CANON	1
       
   126 # define	_PC_MAX_INPUT	2
       
   127 # define	_PC_NAME_MAX	3
       
   128 # define	_PC_PATH_MAX	4
       
   129 # define	_PC_PIPE_BUF	5
       
   130 # define	_PC_CHOWN_RESTRICTED	6
       
   131 # define	_PC_NO_TRUNC	7
       
   132 # define	_PC_VDISABLE	8
       
   133 
       
   134 # define	F_OK	0
       
   135 # define	R_OK	4
       
   136 # define	W_OK	2
       
   137 # define	X_OK	1
       
   138 
       
   139 # define	SEEK_SET	0
       
   140 # define	SEEK_CUR	1
       
   141 # define	SEEK_END	2
       
   142 
       
   143 #ifdef __svr4__
       
   144 # define _POSIX_JOB_CONTROL	1
       
   145 # define _POSIX_SAVED_IDS	1
       
   146 # define _POSIX_VERSION	199009L
       
   147 #endif
       
   148 /**
       
   149 @publishedAll
       
   150 @released
       
   151 */
       
   152 #define STDIN_FILENO    0       /* standard input file descriptor */
       
   153 /**
       
   154 @publishedAll
       
   155 @released
       
   156 */
       
   157 #define STDOUT_FILENO   1       /* standard output file descriptor */
       
   158 /**
       
   159 @publishedAll
       
   160 @released
       
   161 */
       
   162 #define STDERR_FILENO   2       /* standard error file descriptor */
       
   163 
       
   164 # ifndef	_POSIX_SOURCE
       
   165 #  define	MAXNAMLEN	256	/* E32STD.H: KMaxName */	
       
   166 # endif		/* _POSIX_SOURCE */
       
   167 
       
   168 # define	MAXPATHLEN	256	/* E32STD.H: KMaxFullName */
       
   169 
       
   170 #ifdef __cplusplus
       
   171 }
       
   172 #endif
       
   173 #endif