stat.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 __uefi__
  21. #include <uefi/sys/stat.c>
  22. #elif __i386__
  23. #include <x86/linux/sys/stat.c>
  24. #elif __x86_64__
  25. #include <amd64/linux/sys/stat.c>
  26. #elif __arm__
  27. #include <armv7l/linux/sys/stat.c>
  28. #elif __aarch64__
  29. #include <aarch64/linux/sys/stat.c>
  30. #elif __riscv && __riscv_xlen==32
  31. #include <riscv32/linux/sys/stat.c>
  32. #elif __riscv && __riscv_xlen==64
  33. #include <riscv64/linux/sys/stat.c>
  34. #else
  35. #error arch not supported
  36. #endif
  37. #else
  38. #include <sys/types.h>
  39. #define S_IRWXU 00700
  40. #define S_IXUSR 00100
  41. #define S_IWUSR 00200
  42. #define S_IRUSR 00400
  43. #define S_ISUID 04000
  44. #define S_ISGID 02000
  45. #define S_IXGRP 00010
  46. #define S_IXOTH 00001
  47. #define S_IRGRP 00040
  48. #define S_IROTH 00004
  49. #define S_IWGRP 00020
  50. #define S_IWOTH 00002
  51. #define S_IRWXG 00070
  52. #define S_IRWXO 00007
  53. int chmod(char *pathname, int mode);
  54. int fchmod(int a, mode_t b);
  55. int mkdir(char const* a, mode_t b);
  56. int mknod(char const* a, mode_t b, dev_t c);
  57. mode_t umask(mode_t m);
  58. #endif
  59. #endif