20 #ifndef FILE_SYSCALLS_H 21 #define FILE_SYSCALLS_H 23 #include "modules/system/vfs/File.h" 24 #include "modules/system/vfs/Filesystem.h" 25 #include "modules/system/vfs/VFS.h" 30 #include <sys/types.h> 42 int posix_close(
int fd);
43 int posix_open(
const char *name,
int flags,
int mode);
44 int posix_read(
int fd,
char *ptr,
int len);
45 int posix_write(
int fd,
char *ptr,
int len,
bool nocheck =
false);
46 off_t posix_lseek(
int file, off_t ptr,
int dir);
47 int posix_link(
char *old,
char *_new);
48 int posix_unlink(
char *name);
49 int posix_stat(
const char *file,
struct stat *st);
50 int posix_fstat(
int fd,
struct stat *st);
51 int posix_lstat(
char *file,
struct stat *st);
52 int posix_rename(
const char *src,
const char *dst);
53 int posix_symlink(
char *target,
char *link);
55 int posix_writev(
int fd,
const struct iovec *iov,
int iovcnt);
56 int posix_readv(
int fd,
const struct iovec *iov,
int iovcnt);
58 int posix_getcwd(
char *buf,
size_t maxlen);
59 int posix_readlink(
const char *path,
char *buf,
unsigned int bufsize);
60 int posix_realpath(
const char *path,
char *buf,
size_t bufsize);
62 int posix_getdents(
int fd,
struct linux_dirent *ents,
int count);
63 int posix_getdents64(
int fd,
struct dirent *ents,
int count);
65 int posix_ioctl(
int fd,
size_t operation,
void *buf);
67 int posix_chmod(
const char *path, mode_t mode);
68 int posix_chown(
const char *path, uid_t owner, gid_t group);
69 int posix_fchmod(
int fd, mode_t mode);
70 int posix_fchown(
int fd, uid_t owner, gid_t group);
71 int posix_chdir(
const char *path);
72 int posix_fchdir(
int fd);
74 int posix_dup(
int fd);
75 int posix_dup2(
int fd1,
int fd2);
77 int posix_fcntl(
int fd,
int cmd,
void *arg);
79 int posix_mkdir(
const char *name,
int mode);
80 int posix_rmdir(
const char *path);
82 int posix_isatty(
int fd);
85 posix_mmap(
void *addr,
size_t len,
int prot,
int flags,
int fd, off_t off);
86 int posix_msync(
void *p,
size_t len,
int flags);
87 int posix_munmap(
void *addr,
size_t len);
88 int posix_mprotect(
void *addr,
size_t len,
int prot);
90 int posix_access(
const char *name,
int amode);
92 int posix_ftruncate(
int a, off_t b);
94 int posix_fsync(
int fd);
96 int posix_fstatvfs(
int fd,
struct statvfs *buf);
97 int posix_statvfs(
const char *path,
struct statvfs *buf);
99 int posix_utime(
const char *path,
const struct utimbuf *times);
100 int posix_utimes(
const char *path,
const struct timeval *times);
102 int posix_chroot(
const char *path);
103 int posix_flock(
int fd,
int operation);
105 bool normalisePath(
String &nameToOpen,
const char *name,
bool *onDevFs = 0);
108 File *findFileWithAbiFallbacks(
const String &name,
File *cwd =
nullptr);
110 int posix_openat(
int dirfd,
const char *pathname,
int flags, mode_t mode);
111 int posix_mkdirat(
int dirfd,
const char *pathname, mode_t mode);
113 int dirfd,
const char *pathname, uid_t owner, gid_t group,
int flags);
115 int dirfd,
const char *pathname,
const struct timeval *times);
116 int posix_fstatat(
int dirfd,
const char *pathname,
struct stat *buf,
int flags);
117 int posix_unlinkat(
int dirfd,
const char *pathname,
int flags);
119 int olddirfd,
const char *oldpath,
int newdirfd,
const char *newpath);
121 int olddirfd,
const char *oldpath,
int newdirfd,
const char *newpath,
123 int posix_symlinkat(
const char *oldpath,
int newdirfd,
const char *newpath);
124 int posix_readlinkat(
int dirfd,
const char *pathname,
char *buf,
size_t bufsiz);
125 int posix_fchmodat(
int dirfd,
const char *pathname, mode_t mode,
int flags);
126 int posix_faccessat(
int dirfd,
const char *pathname,
int mode,
int flags);
129 posix_getxattr(
const char *path,
const char *name,
void *value,
size_t size);
131 posix_lgetxattr(
const char *path,
const char *name,
void *value,
size_t size);
132 ssize_t posix_fgetxattr(
int fd,
const char *name,
void *value,
size_t size);
134 int posix_mknod(
const char *pathname, mode_t mode, dev_t dev);
136 int posix_statfs(
const char *path,
struct statfs *buf);
137 int posix_fstatfs(
int fd,
struct statfs *buf);
139 int posix_mount(
const char *,
const char *,
const char *,
size_t,
const void *);
141 void generate_mtab(
String &result);
143 int pedigree_get_mount(
char *mount_buf,
char *info_buf,
size_t n);