2 * Acess2 POSIX Emulation Layer
13 //! \brief flags for open(2)
19 #define O_DIRECTORY 0x10
22 #define O_NOFOLLOW 0x80 // don't follow symlinks
24 #define O_NOCTTY 0 // unsupported
25 #define O_NONBLOCK 0x200
26 #define O_SYNC 0 // not supported
28 #define STDIN_FILENO 0
29 #define STDOUT_FILENO 1
30 #define STDERR_FILENO 2
32 typedef signed long ssize_t;
34 #include "sys/stat.h" // mode_t
36 extern int open(const char *path, int flags, ...);
37 extern int creat(const char *path, mode_t mode);
38 extern int close(int fd);
40 extern ssize_t write(int fd, const void *buf, size_t count);
41 extern ssize_t read(int fd, void *buf, size_t count);
42 extern off_t lseek(int fd, off_t offset, int whence);
44 extern int fork(void);
45 extern int execv(const char *b, char *v[]);
47 extern int dup2(int oldfd, int newfd);
49 extern int chown(const char *path, uid_t owner, gid_t group);
66 extern int chmod(const char *path, mode_t mode);
68 extern pid_t setsid(void);
70 extern uid_t getuid(void);
71 extern uid_t geteuid(void);
72 extern pid_t getpid(void);
74 // signal.h / sys/types.h
77 extern int kill(pid_t pid, int sig);
79 extern int chdir(const char *dir);
81 // Deprecated POSIX.1-2001
83 extern char *getpass(const char *prompt);