| #ifndef _UNISTD_H |
| #define _UNISTD_H |
| |
| #define _IO_H_ // Not a nativelibc header file |
| |
| #include <sys/types.h> |
| |
| /* |
| * Attributes of files as returned by _findfirst et al. |
| */ |
| #define _A_NORMAL 0x00000000 |
| #define _A_RDONLY 0x00000001 |
| #define _A_HIDDEN 0x00000002 |
| #define _A_SYSTEM 0x00000004 |
| #define _A_VOLID 0x00000008 |
| #define _A_SUBDIR 0x00000010 |
| #define _A_ARCH 0x00000020 |
| |
| /* Standard file descriptors (pseudo) */ |
| #define STDIN_FILENO 0 /* Standard input. */ |
| #define STDOUT_FILENO 1 /* Standard output. */ |
| #define STDERR_FILENO 2 /* Standard error output. */ |
| |
| #define IS_STD_PSEUDO_FD(N) ((N)==STDIN_FILENO || (N)==STDOUT_FILENO || (N)==STDERR_FILENO) |
| |
| #ifndef _INTPTR_T_DEFINED |
| #define _INTPTR_T_DEFINED |
| #ifdef _WIN64 |
| typedef __int64 intptr_t; |
| #else |
| typedef int intptr_t; |
| #endif |
| #endif |
| |
| #ifndef _FSIZE_T_DEFINED |
| typedef unsigned long _fsize_t; |
| #define _FSIZE_T_DEFINED |
| #endif |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| int __cdecl __MINGW_NOTHROW chdir(const char *); |
| char *__cdecl __MINGW_NOTHROW getcwd(char *, int); |
| char *__cdecl __MINGW_NOTHROW mktemp(char *); |
| //int __cdecl __MINGW_NOTHROW chmod(const char *, mode_t); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #define F_OK 0 /* Check for file existence */ |
| #define X_OK 1 /* Execute permission, Always OK */ |
| #define W_OK 2 /* Check for write permission */ |
| #define R_OK 4 /* Check for read permission */ |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| int __cdecl __MINGW_NOTHROW access(const char *, int); |
| int __cdecl __MINGW_NOTHROW close(int); |
| int __cdecl __MINGW_NOTHROW commit(int); |
| |
| /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), |
| * the "owner write permission" bit (on FAT). */ |
| int __cdecl __MINGW_NOTHROW creat(const char *, mode_t); |
| |
| int __cdecl __MINGW_NOTHROW dup(int); |
| int __cdecl __MINGW_NOTHROW dup2(int, int); |
| int __cdecl __MINGW_NOTHROW isatty(int); |
| |
| /* LK_... locking commands defined in sys/locking.h. */ |
| int __cdecl __MINGW_NOTHROW _locking(int, int, long); |
| |
| #ifndef _STDIO_H |
| /* These are also defined in stdio.h. */ |
| #ifndef SEEK_SET |
| #define SEEK_SET 0 |
| #endif |
| |
| #ifndef SEEK_CUR |
| #define SEEK_CUR 1 |
| #endif |
| |
| #ifndef SEEK_END |
| #define SEEK_END 2 |
| #endif |
| #endif |
| |
| long __cdecl __MINGW_NOTHROW lseek(int, off_t, int); |
| |
| /* Optional third argument is unsigned unPermissions. */ |
| int __cdecl __MINGW_NOTHROW open(const char *, int, ...); |
| |
| int __cdecl __MINGW_NOTHROW pipe(int *); |
| int __cdecl __MINGW_NOTHROW read(int, void *, size_t); |
| int __cdecl __MINGW_NOTHROW _setmode(int, int); |
| long __cdecl __MINGW_NOTHROW _tell(int); |
| int __cdecl __MINGW_NOTHROW link(const char *, const char *); |
| int __cdecl __MINGW_NOTHROW symlink(const char *, const char *); |
| int __cdecl __MINGW_NOTHROW fsync(int); |
| int __cdecl __MINGW_NOTHROW unlink(const char *); |
| int __cdecl __MINGW_NOTHROW write(int, const void *, size_t); |
| int __cdecl __MINGW_NOTHROW readlink(const char *, char *, size_t); |
| int __cdecl __MINGW_NOTHROW rmdir(const char *); |
| |
| int __cdecl __MINGW_NOTHROW truncate(const char *, off_t); |
| int __cdecl __MINGW_NOTHROW ftruncate(int, off_t); |
| |
| |
| #define TTY_FD_INVALID (-1) |
| #define TTY_FD_DEFAULT (-2) |
| |
| int _get_stdin_fd(void **); |
| int _get_stdout_fd(void); |
| int _get_stderr_fd(void); |
| int _set_stdin_fd(int); |
| int _set_stdout_fd(int); |
| int _set_stderr_fd(int); |
| |
| int _get_std_fd(int pseudo_fd); |
| int _set_std_fd(int pseudo_fd, int real_fd); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| //#include <process.h> |
| #define _PROCESS_H_ // Not a nativelibc header file |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| void __cdecl __MINGW_NOTHROW _exit(int) __MINGW_ATTRIB_NORETURN; |
| pid_t __cdecl __MINGW_NOTHROW fork(void); |
| pid_t __cdecl __MINGW_NOTHROW getpid(void); |
| pid_t __cdecl __MINGW_NOTHROW getppid(void); |
| |
| unsigned int __cdecl __MINGW_NOTHROW sleep(unsigned int); |
| int __cdecl __MINGW_NOTHROW usleep(unsigned long int); |
| |
| int __cdecl __MINGW_NOTHROW getpagesize(void); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #define __UNISTD_GETOPT__ |
| #include <getopt.h> |
| #undef __UNISTD_GETOPT__ |
| |
| #endif |