| [18] | 1 | /* unistd.h (emx+gcc) */
|
|---|
| 2 |
|
|---|
| 3 | #ifndef _UNISTD_H
|
|---|
| 4 | #define _UNISTD_H
|
|---|
| [183] | 5 | #define _UNISTD_H_ /* toolkit compatibility */
|
|---|
| [18] | 6 |
|
|---|
| 7 | #if defined (__cplusplus)
|
|---|
| 8 | extern "C" {
|
|---|
| 9 | #endif
|
|---|
| 10 |
|
|---|
| 11 | #if defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE)
|
|---|
| 12 | #define _POSIX_SOURCE
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #if !defined (_SIZE_T)
|
|---|
| 16 | #define _SIZE_T
|
|---|
| 17 | typedef unsigned long size_t;
|
|---|
| 18 | #endif
|
|---|
| 19 |
|
|---|
| 20 | #if !defined (_SSIZE_T)
|
|---|
| 21 | #define _SSIZE_T
|
|---|
| 22 | typedef int ssize_t;
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | #if !defined (NULL)
|
|---|
| 26 | #if defined (__cplusplus)
|
|---|
| 27 | #define NULL 0
|
|---|
| 28 | #else
|
|---|
| 29 | #define NULL ((void *)0)
|
|---|
| 30 | #endif
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #if !defined (STDIN_FILENO)
|
|---|
| 34 | #define STDIN_FILENO 0
|
|---|
| 35 | #define STDOUT_FILENO 1
|
|---|
| 36 | #define STDERR_FILENO 2
|
|---|
| 37 | #endif
|
|---|
| 38 |
|
|---|
| 39 | #if !defined (F_OK)
|
|---|
| 40 | #define F_OK 0
|
|---|
| 41 | #define X_OK 1
|
|---|
| 42 | #define W_OK 2
|
|---|
| 43 | #define R_OK 4
|
|---|
| 44 | #endif
|
|---|
| 45 |
|
|---|
| 46 | #if !defined (SEEK_SET)
|
|---|
| 47 | #define SEEK_SET 0
|
|---|
| 48 | #define SEEK_CUR 1
|
|---|
| 49 | #define SEEK_END 2
|
|---|
| 50 | #endif
|
|---|
| 51 |
|
|---|
| 52 | #if !defined (_PC_LINK_MAX)
|
|---|
| 53 | #define _PC_LINK_MAX 1
|
|---|
| 54 | #define _PC_MAX_CANON 2
|
|---|
| 55 | #define _PC_MAX_INPUT 3
|
|---|
| 56 | #define _PC_NAME_MAX 4
|
|---|
| 57 | #define _PC_PATH_MAX 5
|
|---|
| 58 | #define _PC_PIPE_BUF 6
|
|---|
| 59 | #define _PC_CHOWN_RESTRICTED 7
|
|---|
| 60 | #define _PC_NO_TRUNC 8
|
|---|
| 61 | #define _PC_VDISABLE 9
|
|---|
| 62 | #endif
|
|---|
| 63 |
|
|---|
| 64 | #if !defined (_SC_ARG_MAX)
|
|---|
| 65 | #define _SC_ARG_MAX 1
|
|---|
| 66 | #define _SC_CHILD_MAX 2
|
|---|
| 67 | #define _SC_CLK_TCK 3
|
|---|
| 68 | #define _SC_NGROUPS_MAX 4
|
|---|
| 69 | #define _SC_OPEN_MAX 5
|
|---|
| 70 | #define _SC_STREAM_MAX 6
|
|---|
| 71 | #define _SC_TZNAME_MAX 7
|
|---|
| 72 | #define _SC_JOB_CONTROL 8
|
|---|
| 73 | #define _SC_SAVED_IDS 9
|
|---|
| 74 | #define _SC_VERSION 10
|
|---|
| 75 | #endif
|
|---|
| 76 |
|
|---|
| 77 | #if !defined (_POSIX_VERSION)
|
|---|
| 78 | #define _POSIX_VERSION 199009L
|
|---|
| 79 | #endif
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | int access (__const__ char *, int);
|
|---|
| 83 | unsigned alarm (unsigned);
|
|---|
| 84 | int chdir (__const__ char *);
|
|---|
| 85 | /* chown() */
|
|---|
| 86 | int close (int);
|
|---|
| 87 | /* ctermid() */
|
|---|
| 88 | char *cuserid (char *);
|
|---|
| 89 | int dup (int);
|
|---|
| 90 | int dup2 (int, int);
|
|---|
| 91 | int execl (__const__ char *, __const__ char *, ...);
|
|---|
| 92 | int execle (__const__ char *, __const__ char *, ...);
|
|---|
| 93 | int execlp (__const__ char *, __const__ char *, ...);
|
|---|
| 94 | int execv (__const__ char *, char * __const__ *);
|
|---|
| 95 | int execve (__const__ char *, char * __const__ *, char * __const__ *);
|
|---|
| 96 | int execvp (__const__ char *, char * __const__ *);
|
|---|
| 97 | void _exit (int) __attribute__ ((__noreturn__));
|
|---|
| 98 | int fork (void);
|
|---|
| 99 | long fpathconf (int, int);
|
|---|
| 100 | char *getcwd (char *, size_t);
|
|---|
| 101 | int getegid (void); /* gid_t getegid (void); */
|
|---|
| 102 | int geteuid (void); /* uid_t geteuid (void); */
|
|---|
| 103 | int getgid (void); /* gid_t getgid (void); */
|
|---|
| 104 | int getgroups (int, int *); /* int getgroups (int, gid_t *); */
|
|---|
| 105 | char *getlogin (void);
|
|---|
| 106 | int getpgrp (void); /* pid_t getpgrp (void); */
|
|---|
| 107 | int getpid (void); /* pid_t getpid (void); */
|
|---|
| 108 | int getppid (void); /* pid_t getppid (void); */
|
|---|
| 109 | int getuid (void); /* uid_t getuid (void); */
|
|---|
| 110 | int isatty (int);
|
|---|
| 111 | /* link() */
|
|---|
| 112 | long lseek (int, long, int);
|
|---|
| 113 | long pathconf (__const__ char *, int);
|
|---|
| 114 | int pause (void);
|
|---|
| 115 | int pipe (int *);
|
|---|
| 116 | int read (int, void *, size_t);
|
|---|
| 117 | int rmdir (__const__ char *);
|
|---|
| 118 | int setgid (int); /* int setsid (gid_t); */
|
|---|
| 119 | int setpgid (int, int); /* int setpgid (gid_t, gid_t); */
|
|---|
| 120 | int setsid (void); /* pid_t setsid (void); */
|
|---|
| 121 | int setuid (int); /* setuid (uid_t); */
|
|---|
| 122 | unsigned sleep (unsigned);
|
|---|
| 123 | long sysconf (int);
|
|---|
| 124 | int tcgetpgrp (int); /* pid_t tcgetpgrp (int); */
|
|---|
| 125 | int tcsetpgrp (int, int); /* int tcsetpgrp (int, pid_t) */
|
|---|
| 126 | char *ttyname (int);
|
|---|
| 127 | int unlink (__const__ char *);
|
|---|
| 128 | int write (int, __const__ void *, size_t);
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 | #if !defined (_POSIX_SOURCE)
|
|---|
| 132 |
|
|---|
| 133 | void *brk (void *);
|
|---|
| 134 | char *getpass (__const__ char *);
|
|---|
| 135 | char *_getpass1 (__const__ char *);
|
|---|
| 136 | char *_getpass2 (__const__ char *, int);
|
|---|
| 137 | int mkstemp (char *);
|
|---|
| 138 | char *mktemp (char *);
|
|---|
| 139 | int profil (void *, unsigned, unsigned, unsigned);
|
|---|
| 140 | void *sbrk (int);
|
|---|
| 141 |
|
|---|
| 142 | #endif
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 | #if !defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 2
|
|---|
| 146 |
|
|---|
| 147 | extern char *optarg;
|
|---|
| 148 | extern int optind;
|
|---|
| |
|---|