stat.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Copyright (C) 2020 Jeremiah Orians
  2. * This file is part of M2-Planet.
  3. *
  4. * M2-Planet is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * M2-Planet is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _SYS_STAT_H
  18. #define _SYS_STAT_H
  19. #ifdef __M2__
  20. #if __i386__
  21. #include <x86/linux/sys/stat.c>
  22. #elif __x86_64__
  23. #include <amd64/linux/sys/stat.c>
  24. #elif __arm__
  25. #include <armv7l/linux/sys/stat.c>
  26. #elif __aarch64__
  27. #include <aarch64/linux/sys/stat.c>
  28. #elif __riscv && __riscv_xlen==32
  29. #include <riscv32/linux/sys/stat.c>
  30. #elif __riscv && __riscv_xlen==64
  31. #include <riscv64/linux/sys/stat.c>
  32. #else
  33. #error arch not supported
  34. #endif
  35. #else
  36. #include <sys/types.h>
  37. #define S_IRWXU 00700
  38. #define S_IXUSR 00100
  39. #define S_IWUSR 00200
  40. #define S_IRUSR 00400
  41. #define S_ISUID 04000
  42. #define S_ISGID 02000
  43. #define S_IXGRP 00010
  44. #define S_IXOTH 00001
  45. #define S_IRGRP 00040
  46. #define S_IROTH 00004
  47. #define S_IWGRP 00020
  48. #define S_IWOTH 00002
  49. #define S_IRWXG 00070
  50. #define S_IRWXO 00007
  51. int chmod(char *pathname, int mode);
  52. int fchmod(int a, mode_t b);
  53. int mkdir(char const* a, mode_t b);
  54. int mknod(char const* a, mode_t b, dev_t c);
  55. mode_t umask(mode_t m);
  56. #endif
  57. #endif