stat.cpp 584 B

123456789101112131415161718192021222324252627282930313233
  1. #include <sys/stat.h>
  2. #include <errno.h>
  3. #include <assert.h>
  4. #include <stdio.h>
  5. #include <Kernel/Syscall.h>
  6. extern "C" {
  7. mode_t umask(mode_t mask)
  8. {
  9. return syscall(SC_umask, mask);
  10. }
  11. int mkdir(const char* pathname, mode_t mode)
  12. {
  13. int rc = syscall(SC_mkdir, pathname, mode);
  14. __RETURN_WITH_ERRNO(rc, rc, -1);
  15. }
  16. int chmod(const char* pathname, mode_t mode)
  17. {
  18. int rc = syscall(SC_chmod, pathname, mode);
  19. __RETURN_WITH_ERRNO(rc, rc, -1);
  20. }
  21. int fchmod(int fd, mode_t mode)
  22. {
  23. dbgprintf("FIXME(LibC): fchmod(%d, %o)\n", fd, mode);
  24. ASSERT_NOT_REACHED();
  25. }
  26. }