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