sys_fs.h 852 B

123456789101112131415161718192021222324
  1. /* File-service syscalls (see sys_fs.c); used by syscall.c and the scheduler. */
  2. #ifndef SYS_FS_H
  3. #define SYS_FS_H
  4. #include "syscall.h"
  5. /* Set while a FAT operation is in progress: the scheduler must not switch
  6. * away from the running process (see sys_fs.c). */
  7. extern volatile int sys_fs_busy;
  8. /* Enter/leave the fs-busy section (used by other disk-touching services,
  9. * e.g. the storage info refresh). */
  10. void sys_fs_enter(void);
  11. void sys_fs_exit(void);
  12. int sys_read_file(const char *path, void *buf, unsigned int max);
  13. int sys_write_file(const char *path, const void *buf, unsigned int len);
  14. int sys_unlink(const char *path);
  15. int sys_mkdir(const char *path);
  16. int sys_rmdir(const char *path);
  17. int sys_list_dir(const char *path, unsigned int index, struct sys_dirent *out);
  18. int sys_list_mounts(unsigned int index, struct sys_mount *out);
  19. #endif