stat.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. #ifndef _ASM_POWERPC_STAT_H
  3. #define _ASM_POWERPC_STAT_H
  4. /*
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #include <linux/types.h>
  11. #define STAT_HAVE_NSEC 1
  12. #ifndef __powerpc64__
  13. struct __old_kernel_stat {
  14. unsigned short st_dev;
  15. unsigned short st_ino;
  16. unsigned short st_mode;
  17. unsigned short st_nlink;
  18. unsigned short st_uid;
  19. unsigned short st_gid;
  20. unsigned short st_rdev;
  21. unsigned long st_size;
  22. unsigned long st_atime;
  23. unsigned long st_mtime;
  24. unsigned long st_ctime;
  25. };
  26. #endif /* !__powerpc64__ */
  27. struct stat {
  28. unsigned long st_dev;
  29. __kernel_ino_t st_ino;
  30. #ifdef __powerpc64__
  31. unsigned long st_nlink;
  32. __kernel_mode_t st_mode;
  33. #else
  34. __kernel_mode_t st_mode;
  35. unsigned short st_nlink;
  36. #endif
  37. __kernel_uid32_t st_uid;
  38. __kernel_gid32_t st_gid;
  39. unsigned long st_rdev;
  40. long st_size;
  41. unsigned long st_blksize;
  42. unsigned long st_blocks;
  43. unsigned long st_atime;
  44. unsigned long st_atime_nsec;
  45. unsigned long st_mtime;
  46. unsigned long st_mtime_nsec;
  47. unsigned long st_ctime;
  48. unsigned long st_ctime_nsec;
  49. unsigned long __unused4;
  50. unsigned long __unused5;
  51. #ifdef __powerpc64__
  52. unsigned long __unused6;
  53. #endif
  54. };
  55. /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
  56. struct stat64 {
  57. unsigned long long st_dev; /* Device. */
  58. unsigned long long st_ino; /* File serial number. */
  59. unsigned int st_mode; /* File mode. */
  60. unsigned int st_nlink; /* Link count. */
  61. unsigned int st_uid; /* User ID of the file's owner. */
  62. unsigned int st_gid; /* Group ID of the file's group. */
  63. unsigned long long st_rdev; /* Device number, if device. */
  64. unsigned short __pad2;
  65. long long st_size; /* Size of file, in bytes. */
  66. int st_blksize; /* Optimal block size for I/O. */
  67. long long st_blocks; /* Number 512-byte blocks allocated. */
  68. int st_atime; /* Time of last access. */
  69. unsigned int st_atime_nsec;
  70. int st_mtime; /* Time of last modification. */
  71. unsigned int st_mtime_nsec;
  72. int st_ctime; /* Time of last status change. */
  73. unsigned int st_ctime_nsec;
  74. unsigned int __unused4;
  75. unsigned int __unused5;
  76. };
  77. #endif /* _ASM_POWERPC_STAT_H */