30#define XTC_FS_READ 0x01u
31#define XTC_FS_WRITE 0x02u
32#define XTC_FS_CREATE 0x04u
33#define XTC_FS_TRUNC 0x08u
34#define XTC_FS_APPEND 0x10u
35#define XTC_FS_EXCL 0x20u
36#define XTC_FS_DIRECT 0x40u
44typedef struct xtc_fs_stat {
51typedef struct xtc_fs_dir xtc_fs_dir_t;
54int xtc_fs_open(
const char *path, uint32_t flags,
int *out_fd);
55int xtc_fs_close(
int fd);
56int xtc_fs_pread(
int fd,
void *buf,
size_t n, int64_t off,
size_t *out_done);
57int xtc_fs_pwrite(
int fd,
const void *buf,
size_t n, int64_t off,
size_t *out_done);
58int xtc_fs_fsync(
int fd);
59int xtc_fs_fdatasync(
int fd);
60int xtc_fs_ftruncate(
int fd, int64_t len);
61int xtc_fs_fsize(
int fd, int64_t *out_size);
72int xtc_fs_dio_align(
int fd,
size_t *mem,
size_t *off,
size_t *len);
79int xtc_fs_dio_alloc(
int fd,
size_t size,
void **out);
80void xtc_fs_dio_free(
void *p);
84int xtc_fs_exists(
const char *path);
85int xtc_fs_unlink(
const char *path);
86int xtc_fs_rename(
const char *from,
const char *to);
87int xtc_fs_mkdir(
const char *path);
88int xtc_fs_rmdir(
const char *path);
91int xtc_fs_tmpdir(
char *buf,
size_t cap);
92int xtc_fs_mkstemp(
char *tmpl,
int *out_fd);
95int xtc_fs_dir_open(
const char *path, xtc_fs_dir_t **out);
96int xtc_fs_dir_next(xtc_fs_dir_t *d,
const char **out_name);
97void xtc_fs_dir_close(xtc_fs_dir_t *d);