2023-09-24 01:26:07 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-09-24 20:05:55 +08:00
|
|
|
#include <stddef.h>
|
2023-12-02 23:15:33 +08:00
|
|
|
#include <dirent.h>
|
2025-03-09 00:21:55 +08:00
|
|
|
#include <poll.h>
|
2024-08-27 23:02:54 +08:00
|
|
|
#include <u_types.h>
|
2024-09-12 14:16:30 +08:00
|
|
|
#include <u_rpc.h>
|
2025-03-23 17:35:56 +08:00
|
|
|
int fs_open_raw(obj_handler_t fs_hd, const char *path, int flags, int mode);
|
2024-09-12 14:16:30 +08:00
|
|
|
sd_t fs_open(const char *path, int flags, int mode);
|
2025-03-23 17:35:56 +08:00
|
|
|
int fs_close_raw(obj_handler_t hd, int fd);
|
2024-09-12 14:16:30 +08:00
|
|
|
int fs_close(sd_t _fd);
|
2025-03-23 17:35:56 +08:00
|
|
|
int fs_read_raw(obj_handler_t hd, int fd, void *buf, size_t len);
|
2024-09-12 14:16:30 +08:00
|
|
|
int fs_read(sd_t _fd, void *buf, size_t len);
|
|
|
|
|
int fs_write(sd_t _fd, void *buf, size_t len);
|
|
|
|
|
int fs_readdir(sd_t _fd, dirent_t *dirent);
|
|
|
|
|
int fs_lseek(sd_t _fd, int offs, int whence);
|
2024-08-27 23:02:54 +08:00
|
|
|
int fs_ftruncate(sd_t _fd, off_t off);
|
2025-03-23 17:35:56 +08:00
|
|
|
int fs_fstat_raw(obj_handler_t hd, int fd, kstat_t *stat);
|
|
|
|
|
int fs_fstat(sd_t _fd, kstat_t *stat);
|
2024-09-12 14:16:30 +08:00
|
|
|
int fs_ioctl(sd_t _fd, int req, void *arg);
|
|
|
|
|
int fs_fcntl(sd_t _fd, int cmd, void *arg);
|
2024-08-27 23:02:54 +08:00
|
|
|
int fs_fsync(sd_t _fd);
|
2025-03-18 21:18:26 +08:00
|
|
|
int fs_unlink(obj_handler_t hd, const char *path);
|
2023-12-10 23:51:39 +08:00
|
|
|
int fs_symlink(const char *src, const char *dst);
|
2024-09-12 14:16:30 +08:00
|
|
|
int fs_mkdir(char *path);
|
|
|
|
|
int fs_rmdir(char *path);
|
|
|
|
|
int fs_rename(char *old, char *new);
|
2025-01-08 20:21:09 +08:00
|
|
|
int fs_stat(char *path, void *buf);
|
2024-09-12 14:16:30 +08:00
|
|
|
int fs_readlink(const char *path, char *buf, int bufsize);
|
|
|
|
|
int fs_statfs(const char *path, statfs_t *buf);
|
2025-03-09 00:21:55 +08:00
|
|
|
int fs_poll(struct pollfd *fds, nfds_t n, int timeout);
|