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);
43 extern int fork(void);
44 extern int execv(const char *b, char *v[]);
46 extern int dup2(int oldfd, int newfd);
48 extern int chown(const char *path, uid_t owner, gid_t group);
65 extern int chmod(const char *path, mode_t mode);
67 extern pid_t setsid(void);
69 extern uid_t getuid(void);
70 extern uid_t geteuid(void);
71 extern pid_t getpid(void);
73 // signal.h / sys/types.h
76 extern int kill(pid_t pid, int sig);
78 extern int chdir(const char *dir);
80 // Deprecated POSIX.1-2001
82 extern char *getpass(void);