stat.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * This file is subject to the terms and conditions of the GNU General Public
  4. * License. See the file "COPYING" in the main directory of this archive
  5. * for more details.
  6. *
  7. * Copyright (C) 1995, 1999, 2000 Ralf Baechle
  8. * Copyright (C) 2000 Silicon Graphics, Inc.
  9. */
  10. #ifndef _ASM_STAT_H
  11. #define _ASM_STAT_H
  12. #include <linux/types.h>
  13. #include <asm/sgidefs.h>
  14. #if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
  15. struct stat {
  16. unsigned st_dev;
  17. long st_pad1[3]; /* Reserved for network id */
  18. __kernel_ino_t st_ino;
  19. __kernel_mode_t st_mode;
  20. __u32 st_nlink;
  21. __kernel_uid32_t st_uid;
  22. __kernel_gid32_t st_gid;
  23. unsigned st_rdev;
  24. long st_pad2[2];
  25. long st_size;
  26. long st_pad3;
  27. /*
  28. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  29. * but we don't have it under Linux.
  30. */
  31. long st_atime;
  32. long st_atime_nsec;
  33. long st_mtime;
  34. long st_mtime_nsec;
  35. long st_ctime;
  36. long st_ctime_nsec;
  37. long st_blksize;
  38. long st_blocks;
  39. long st_pad4[14];
  40. };
  41. /*
  42. * This matches struct stat64 in glibc2.1, hence the absolutely insane
  43. * amounts of padding around dev_t's. The memory layout is the same as of
  44. * struct stat of the 64-bit kernel.
  45. */
  46. struct stat64 {
  47. unsigned long st_dev;
  48. unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
  49. unsigned long long st_ino;
  50. __kernel_mode_t st_mode;
  51. __u32 st_nlink;
  52. __kernel_uid32_t st_uid;
  53. __kernel_gid32_t st_gid;
  54. unsigned long st_rdev;
  55. unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
  56. long long st_size;
  57. /*
  58. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  59. * but we don't have it under Linux.
  60. */
  61. long st_atime;
  62. unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
  63. long st_mtime;
  64. unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
  65. long st_ctime;
  66. unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
  67. unsigned long st_blksize;
  68. unsigned long st_pad2;
  69. long long st_blocks;
  70. };
  71. #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
  72. #if _MIPS_SIM == _MIPS_SIM_ABI64
  73. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  74. struct stat {
  75. unsigned int st_dev;
  76. unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
  77. unsigned long st_ino;
  78. __kernel_mode_t st_mode;
  79. __u32 st_nlink;
  80. __kernel_uid32_t st_uid;
  81. __kernel_gid32_t st_gid;
  82. unsigned int st_rdev;
  83. unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
  84. long st_size;
  85. /*
  86. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  87. * but we don't have it under Linux.
  88. */
  89. unsigned int st_atime;
  90. unsigned int st_atime_nsec;
  91. unsigned int st_mtime;
  92. unsigned int st_mtime_nsec;
  93. unsigned int st_ctime;
  94. unsigned int st_ctime_nsec;
  95. unsigned int st_blksize;
  96. unsigned int st_pad2;
  97. unsigned long st_blocks;
  98. };
  99. #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
  100. #define STAT_HAVE_NSEC 1
  101. #endif /* _ASM_STAT_H */