stat.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_C
  18. #define _SYS_STAT_C
  19. #include <uefi/uefi.c>
  20. #include <sys/types.h>
  21. #define S_IRWXU 00700
  22. #define S_IXUSR 00100
  23. #define S_IWUSR 00200
  24. #define S_IRUSR 00400
  25. #define S_ISUID 04000
  26. #define S_ISGID 02000
  27. #define S_IXGRP 00010
  28. #define S_IXOTH 00001
  29. #define S_IRGRP 00040
  30. #define S_IROTH 00004
  31. #define S_IWGRP 00020
  32. #define S_IWOTH 00002
  33. #define S_IRWXG 00070
  34. #define S_IRWXO 00007
  35. int chmod(char *pathname, int mode)
  36. {
  37. return 0;
  38. }
  39. int fchmod(int a, mode_t b)
  40. {
  41. return 0;
  42. }
  43. int __open(struct efi_file_protocol* _rootdir, char* name, long mode, long attributes);
  44. int mkdir(char const* name, mode_t _mode)
  45. {
  46. struct efi_file_protocol* new_directory;
  47. long mode = EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ;
  48. long attributes = EFI_FILE_DIRECTORY;
  49. long new_directory = __open(_rootdir, name, mode, attributes);
  50. if(new_directory != -1)
  51. {
  52. _close(new_directory);
  53. return 0;
  54. }
  55. return -1;
  56. }
  57. int mknod(char const* a, mode_t b, dev_t c)
  58. {
  59. return -1;
  60. }
  61. mode_t umask(mode_t m)
  62. {
  63. return 0;
  64. }
  65. #endif