31#define XTC_FS_READ 0x01u
32#define XTC_FS_WRITE 0x02u
33#define XTC_FS_CREATE 0x04u
34#define XTC_FS_TRUNC 0x08u
35#define XTC_FS_APPEND 0x10u
36#define XTC_FS_EXCL 0x20u
37#define XTC_FS_DIRECT 0x40u
45typedef struct xtc_fs_stat {
52#define XTC_FS_STAT_INIT { .size = sizeof(xtc_fs_stat_t) }
55typedef struct xtc_fs_dir xtc_fs_dir_t;
58int xtc_fs_open(
const char *path, uint32_t flags,
int *out_fd);
59int xtc_fs_close(
int fd);
60int xtc_fs_pread(
int fd,
void *buf,
size_t n, int64_t off,
size_t *out_done);
61int xtc_fs_pwrite(
int fd,
const void *buf,
size_t n, int64_t off,
size_t *out_done);
62int xtc_fs_fsync(
int fd);
63int xtc_fs_fdatasync(
int fd);
64int xtc_fs_ftruncate(
int fd, int64_t len);
65int xtc_fs_fsize(
int fd, int64_t *out_size);
76int xtc_fs_dio_align(
int fd,
size_t *mem,
size_t *off,
size_t *len);
83int xtc_fs_dio_alloc(
int fd,
size_t size,
void **out);
84void xtc_fs_dio_free(
void *p);
88int xtc_fs_exists(
const char *path);
89int xtc_fs_unlink(
const char *path);
90int xtc_fs_rename(
const char *from,
const char *to);
91int xtc_fs_mkdir(
const char *path);
92int xtc_fs_rmdir(
const char *path);
95int xtc_fs_tmpdir(
char *buf,
size_t cap);
96int xtc_fs_mkstemp(
char *tmpl,
int *out_fd);
99int xtc_fs_dir_open(
const char *path, xtc_fs_dir_t **out);
100int xtc_fs_dir_next(xtc_fs_dir_t *d,
const char **out_name);
101void xtc_fs_dir_close(xtc_fs_dir_t *d);