1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef __ASM_SH_STAT_H 3 #define __ASM_SH_STAT_H 4 5 struct __old_kernel_stat { 6 unsigned short st_dev; 7 unsigned short st_ino; 8 unsigned short st_mode; 9 unsigned short st_nlink; 10 unsigned short st_uid; 11 unsigned short st_gid; 12 unsigned short st_rdev; 13 unsigned long st_size; 14 unsigned long st_atime; 15 unsigned long st_mtime; 16 unsigned long st_ctime; 17 }; 18 19 #if defined(__SH5__) || defined(CONFIG_CPU_SH5) 20 struct stat { 21 unsigned short st_dev; 22 unsigned short __pad1; 23 unsigned long st_ino; 24 unsigned short st_mode; 25 unsigned short st_nlink; 26 unsigned short st_uid; 27 unsigned short st_gid; 28 unsigned short st_rdev; 29 unsigned short __pad2; 30 unsigned long st_size; 31 unsigned long st_blksize; 32 unsigned long st_blocks; 33 unsigned long st_atime; 34 unsigned long st_atime_nsec; 35 unsigned long st_mtime; 36 unsigned long st_mtime_nsec; 37 unsigned long st_ctime; 38 unsigned long st_ctime_nsec; 39 unsigned long __unused4; 40 unsigned long __unused5; 41 }; 42 43 /* This matches struct stat64 in glibc2.1, hence the absolutely 44 * insane amounts of padding around dev_t's. 45 */ 46 struct stat64 { 47 unsigned short st_dev; 48 unsigned char __pad0[10]; 49 50 unsigned long st_ino; 51 unsigned int st_mode; 52 unsigned int st_nlink; 53 54 unsigned long st_uid; 55 unsigned long st_gid; 56 57 unsigned short st_rdev; 58 unsigned char __pad3[10]; 59 60 long long st_size; 61 unsigned long st_blksize; 62 63 unsigned long st_blocks; /* Number 512-byte blocks allocated. */ 64 unsigned long __pad4; /* future possible st_blocks high bits */ 65 66 unsigned long st_atime; 67 unsigned long st_atime_nsec; 68 69 unsigned long st_mtime; 70 unsigned long st_mtime_nsec; 71 72 unsigned long st_ctime; 73 unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */ 74 75 unsigned long __unused1; 76 unsigned long __unused2; 77 }; 78 #else 79 struct stat { 80 unsigned long st_dev; 81 unsigned long st_ino; 82 unsigned short st_mode; 83 unsigned short st_nlink; 84 unsigned short st_uid; 85 unsigned short st_gid; 86 unsigned long st_rdev; 87 unsigned long st_size; 88 unsigned long st_blksize; 89 unsigned long st_blocks; 90 unsigned long st_atime; 91 unsigned long st_atime_nsec; 92 unsigned long st_mtime; 93 unsigned long st_mtime_nsec; 94 unsigned long st_ctime; 95 unsigned long st_ctime_nsec; 96 unsigned long __unused4; 97 unsigned long __unused5; 98 }; 99 100 /* This matches struct stat64 in glibc2.1, hence the absolutely 101 * insane amounts of padding around dev_t's. 102 */ 103 struct stat64 { 104 unsigned long long st_dev; 105 unsigned char __pad0[4]; 106 107 #define STAT64_HAS_BROKEN_ST_INO 1 108 unsigned long __st_ino; 109 110 unsigned int st_mode; 111 unsigned int st_nlink; 112 113 unsigned long st_uid; 114 unsigned long st_gid; 115 116 unsigned long long st_rdev; 117 unsigned char __pad3[4]; 118 119 long long st_size; 120 unsigned long st_blksize; 121 122 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ 123 124 unsigned long st_atime; 125 unsigned long st_atime_nsec; 126 127 unsigned long st_mtime; 128 unsigned long st_mtime_nsec; 129 130 unsigned long st_ctime; 131 unsigned long st_ctime_nsec; 132 133 unsigned long long st_ino; 134 }; 135 136 #define STAT_HAVE_NSEC 1 137 #endif 138 139 #endif /* __ASM_SH_STAT_H */ 140