| 1 |
39 |
lampret |
#ifndef _SYS_UNISTD_H
|
| 2 |
|
|
#define _SYS_UNISTD_H
|
| 3 |
|
|
|
| 4 |
|
|
#ifdef __cplusplus
|
| 5 |
|
|
extern "C" {
|
| 6 |
|
|
#endif
|
| 7 |
|
|
|
| 8 |
|
|
#include <_ansi.h>
|
| 9 |
|
|
#include <sys/types.h>
|
| 10 |
|
|
#define __need_size_t
|
| 11 |
|
|
#include <stddef.h>
|
| 12 |
|
|
|
| 13 |
|
|
extern char **environ;
|
| 14 |
|
|
|
| 15 |
56 |
joel |
void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn)));
|
| 16 |
39 |
lampret |
|
| 17 |
56 |
joel |
int _EXFUN(access,(const char *__path, int __amode ));
|
| 18 |
|
|
unsigned _EXFUN(alarm, (unsigned __secs ));
|
| 19 |
|
|
int _EXFUN(chdir, (const char *__path ));
|
| 20 |
|
|
int _EXFUN(chmod, (const char *__path, mode_t __mode ));
|
| 21 |
|
|
int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
|
| 22 |
|
|
int _EXFUN(close, (int __fildes ));
|
| 23 |
|
|
char _EXFUN(*ctermid, (char *__s ));
|
| 24 |
|
|
char _EXFUN(*cuserid, (char *__s ));
|
| 25 |
|
|
int _EXFUN(dup, (int __fildes ));
|
| 26 |
|
|
int _EXFUN(dup2, (int __fildes, int __fildes2 ));
|
| 27 |
|
|
int _EXFUN(execl, (const char *__path, const char *, ... ));
|
| 28 |
|
|
int _EXFUN(execle, (const char *__path, const char *, ... ));
|
| 29 |
|
|
int _EXFUN(execlp, (const char *__file, const char *, ... ));
|
| 30 |
|
|
int _EXFUN(execv, (const char *__path, char * const __argv[] ));
|
| 31 |
|
|
int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] ));
|
| 32 |
|
|
int _EXFUN(execvp, (const char *__file, char * const __argv[] ));
|
| 33 |
39 |
lampret |
pid_t _EXFUN(fork, (void ));
|
| 34 |
56 |
joel |
long _EXFUN(fpathconf, (int __fd, int __name ));
|
| 35 |
|
|
int _EXFUN(fsync, (int __fd));
|
| 36 |
|
|
char _EXFUN(*getcwd, (char *__buf, size_t __size ));
|
| 37 |
39 |
lampret |
gid_t _EXFUN(getegid, (void ));
|
| 38 |
|
|
uid_t _EXFUN(geteuid, (void ));
|
| 39 |
|
|
gid_t _EXFUN(getgid, (void ));
|
| 40 |
56 |
joel |
int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
|
| 41 |
39 |
lampret |
char _EXFUN(*getlogin, (void ));
|
| 42 |
56 |
joel |
char _EXFUN(*getpass, (__const char *__prompt));
|
| 43 |
39 |
lampret |
size_t _EXFUN(getpagesize, (void));
|
| 44 |
|
|
pid_t _EXFUN(getpgrp, (void ));
|
| 45 |
|
|
pid_t _EXFUN(getpid, (void ));
|
| 46 |
|
|
pid_t _EXFUN(getppid, (void ));
|
| 47 |
|
|
uid_t _EXFUN(getuid, (void ));
|
| 48 |
56 |
joel |
int _EXFUN(isatty, (int __fildes ));
|
| 49 |
|
|
int _EXFUN(link, (const char *__path1, const char *__path2 ));
|
| 50 |
|
|
int _EXFUN(nice, (int __nice_value ));
|
| 51 |
|
|
off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
|
| 52 |
|
|
long _EXFUN(pathconf, (const char *__path, int __name ));
|
| 53 |
39 |
lampret |
int _EXFUN(pause, (void ));
|
| 54 |
56 |
joel |
int _EXFUN(pipe, (int __fildes[2] ));
|
| 55 |
|
|
int _EXFUN(read, (int __fildes, void *__buf, size_t __nbyte ));
|
| 56 |
|
|
int _EXFUN(rmdir, (const char *__path ));
|
| 57 |
|
|
void * _EXFUN(sbrk, (size_t __incr));
|
| 58 |
|
|
int _EXFUN(setgid, (gid_t __gid ));
|
| 59 |
|
|
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
|
| 60 |
39 |
lampret |
pid_t _EXFUN(setsid, (void ));
|
| 61 |
56 |
joel |
int _EXFUN(setuid, (uid_t __uid ));
|
| 62 |
|
|
unsigned _EXFUN(sleep, (unsigned int __seconds ));
|
| 63 |
39 |
lampret |
void _EXFUN(swab, (const void *, void *, ssize_t));
|
| 64 |
56 |
joel |
long _EXFUN(sysconf, (int __name ));
|
| 65 |
|
|
pid_t _EXFUN(tcgetpgrp, (int __fildes ));
|
| 66 |
|
|
int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
|
| 67 |
|
|
char _EXFUN(*ttyname, (int __fildes ));
|
| 68 |
|
|
int _EXFUN(unlink, (const char *__path ));
|
| 69 |
|
|
int _EXFUN(write, (int __fildes, const void *__buf, size_t __nbyte ));
|
| 70 |
39 |
lampret |
|
| 71 |
|
|
/* Provide prototypes for most of the _<systemcall> names that are
|
| 72 |
|
|
provided in newlib for some compilers. */
|
| 73 |
56 |
joel |
int _EXFUN(_close, (int __fildes ));
|
| 74 |
39 |
lampret |
pid_t _EXFUN(_fork, (void ));
|
| 75 |
|
|
pid_t _EXFUN(_getpid, (void ));
|
| 76 |
56 |
joel |
int _EXFUN(_link, (const char *__path1, const char *__path2 ));
|
| 77 |
|
|
off_t _EXFUN(_lseek, (int __fildes, off_t __offset, int __whence ));
|
| 78 |
|
|
int _EXFUN(_read, (int __fildes, void *__buf, size_t __nbyte ));
|
| 79 |
|
|
void * _EXFUN(_sbrk, (size_t __incr));
|
| 80 |
|
|
int _EXFUN(_unlink, (const char *__path ));
|
| 81 |
|
|
int _EXFUN(_write, (int __fildes, const void *__buf, size_t __nbyte ));
|
| 82 |
39 |
lampret |
|
| 83 |
56 |
joel |
#if defined(__CYGWIN32__) || defined(__rtems__)
|
| 84 |
|
|
unsigned _EXFUN(usleep, (unsigned int __useconds));
|
| 85 |
|
|
int _EXFUN(ftruncate, (int __fd, off_t __length));
|
| 86 |
|
|
int _EXFUN(truncate, (const char *, off_t __length));
|
| 87 |
|
|
int _EXFUN(gethostname, (char *__name, size_t __len));
|
| 88 |
39 |
lampret |
char * _EXFUN(mktemp, (char *));
|
| 89 |
56 |
joel |
int _EXFUN(sync, (void));
|
| 90 |
|
|
int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
|
| 91 |
|
|
int _EXFUN(symlink, (const char *__name1, const char *__name2));
|
| 92 |
39 |
lampret |
#endif
|
| 93 |
|
|
|
| 94 |
|
|
# define F_OK 0
|
| 95 |
|
|
# define R_OK 4
|
| 96 |
|
|
# define W_OK 2
|
| 97 |
|
|
# define X_OK 1
|
| 98 |
|
|
|
| 99 |
|
|
# define SEEK_SET 0
|
| 100 |
|
|
# define SEEK_CUR 1
|
| 101 |
|
|
# define SEEK_END 2
|
| 102 |
|
|
|
| 103 |
56 |
joel |
/*
|
| 104 |
|
|
* RTEMS adheres to a later version of POSIX -- 1003.1b.
|
| 105 |
|
|
*
|
| 106 |
|
|
* XXX this version string should change.
|
| 107 |
|
|
*/
|
| 108 |
|
|
|
| 109 |
|
|
#ifdef __rtems__
|
| 110 |
|
|
#ifndef _POSIX_JOB_CONTROL
|
| 111 |
|
|
# define _POSIX_JOB_CONTROL 1
|
| 112 |
|
|
#endif
|
| 113 |
|
|
#ifndef _POSIX_SAVED_IDS
|
| 114 |
|
|
# define _POSIX_SAVED_IDS 1
|
| 115 |
|
|
#endif
|
| 116 |
|
|
# define _POSIX_VERSION 199009L
|
| 117 |
|
|
#else
|
| 118 |
39 |
lampret |
#ifdef __svr4__
|
| 119 |
56 |
joel |
# define _POSIX_JOB_CONTROL 1
|
| 120 |
|
|
# define _POSIX_SAVED_IDS 1
|
| 121 |
|
|
# define _POSIX_VERSION 199009L
|
| 122 |
39 |
lampret |
#endif
|
| 123 |
56 |
joel |
#endif
|
| 124 |
39 |
lampret |
|
| 125 |
|
|
#ifdef __CYGWIN32__
|
| 126 |
|
|
# define _POSIX_JOB_CONTROL 1
|
| 127 |
|
|
# define _POSIX_SAVED_IDS 0
|
| 128 |
|
|
# define _POSIX_VERSION 199009L
|
| 129 |
|
|
#endif
|
| 130 |
|
|
|
| 131 |
|
|
#define STDIN_FILENO 0 /* standard input file descriptor */
|
| 132 |
|
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
| 133 |
|
|
#define STDERR_FILENO 2 /* standard error file descriptor */
|
| 134 |
|
|
|
| 135 |
56 |
joel |
long _EXFUN(sysconf, (int __name));
|
| 136 |
39 |
lampret |
|
| 137 |
|
|
# define _SC_ARG_MAX 0
|
| 138 |
|
|
# define _SC_CHILD_MAX 1
|
| 139 |
|
|
# define _SC_CLK_TCK 2
|
| 140 |
|
|
# define _SC_NGROUPS_MAX 3
|
| 141 |
|
|
# define _SC_OPEN_MAX 4
|
| 142 |
|
|
/* no _SC_STREAM_MAX */
|
| 143 |
|
|
# define _SC_JOB_CONTROL 5
|
| 144 |
|
|
# define _SC_SAVED_IDS 6
|
| 145 |
|
|
# define _SC_VERSION 7
|
| 146 |
|
|
# define _SC_PAGESIZE 8
|
| 147 |
|
|
|
| 148 |
|
|
# define _PC_LINK_MAX 0
|
| 149 |
|
|
# define _PC_MAX_CANON 1
|
| 150 |
|
|
# define _PC_MAX_INPUT 2
|
| 151 |
|
|
# define _PC_NAME_MAX 3
|
| 152 |
|
|
# define _PC_PATH_MAX 4
|
| 153 |
|
|
# define _PC_PIPE_BUF 5
|
| 154 |
|
|
# define _PC_CHOWN_RESTRICTED 6
|
| 155 |
|
|
# define _PC_NO_TRUNC 7
|
| 156 |
|
|
# define _PC_VDISABLE 8
|
| 157 |
56 |
joel |
# define _PC_ASYNC_IO 9
|
| 158 |
|
|
# define _PC_PRIO_IO 10
|
| 159 |
|
|
# define _PC_SYNC_IO 11
|
| 160 |
39 |
lampret |
|
| 161 |
|
|
# ifndef _POSIX_SOURCE
|
| 162 |
|
|
# define MAXNAMLEN 1024
|
| 163 |
|
|
# endif /* _POSIX_SOURCE */
|
| 164 |
|
|
|
| 165 |
|
|
/* FIXME: This is temporary until winsup gets sorted out. */
|
| 166 |
|
|
#ifdef __CYGWIN32__
|
| 167 |
|
|
#define MAXPATHLEN (260 - 1 /* NUL */)
|
| 168 |
|
|
#else
|
| 169 |
|
|
# define MAXPATHLEN 1024
|
| 170 |
|
|
#endif
|
| 171 |
|
|
|
| 172 |
|
|
#ifdef __cplusplus
|
| 173 |
|
|
}
|
| 174 |
|
|
#endif
|
| 175 |
|
|
#endif /* _SYS_UNISTD_H */
|