xref: /openbmc/linux/arch/arm/include/uapi/asm/stat.h (revision 6f52b16c)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2cb8db5d4SDavid Howells #ifndef _ASMARM_STAT_H
3cb8db5d4SDavid Howells #define _ASMARM_STAT_H
4cb8db5d4SDavid Howells 
5cb8db5d4SDavid Howells struct __old_kernel_stat {
6cb8db5d4SDavid Howells 	unsigned short st_dev;
7cb8db5d4SDavid Howells 	unsigned short st_ino;
8cb8db5d4SDavid Howells 	unsigned short st_mode;
9cb8db5d4SDavid Howells 	unsigned short st_nlink;
10cb8db5d4SDavid Howells 	unsigned short st_uid;
11cb8db5d4SDavid Howells 	unsigned short st_gid;
12cb8db5d4SDavid Howells 	unsigned short st_rdev;
13cb8db5d4SDavid Howells 	unsigned long  st_size;
14cb8db5d4SDavid Howells 	unsigned long  st_atime;
15cb8db5d4SDavid Howells 	unsigned long  st_mtime;
16cb8db5d4SDavid Howells 	unsigned long  st_ctime;
17cb8db5d4SDavid Howells };
18cb8db5d4SDavid Howells 
19cb8db5d4SDavid Howells #define STAT_HAVE_NSEC
20cb8db5d4SDavid Howells 
21cb8db5d4SDavid Howells struct stat {
22cb8db5d4SDavid Howells #if defined(__ARMEB__)
23cb8db5d4SDavid Howells 	unsigned short st_dev;
24cb8db5d4SDavid Howells 	unsigned short __pad1;
25cb8db5d4SDavid Howells #else
26cb8db5d4SDavid Howells 	unsigned long  st_dev;
27cb8db5d4SDavid Howells #endif
28cb8db5d4SDavid Howells 	unsigned long  st_ino;
29cb8db5d4SDavid Howells 	unsigned short st_mode;
30cb8db5d4SDavid Howells 	unsigned short st_nlink;
31cb8db5d4SDavid Howells 	unsigned short st_uid;
32cb8db5d4SDavid Howells 	unsigned short st_gid;
33cb8db5d4SDavid Howells #if defined(__ARMEB__)
34cb8db5d4SDavid Howells 	unsigned short st_rdev;
35cb8db5d4SDavid Howells 	unsigned short __pad2;
36cb8db5d4SDavid Howells #else
37cb8db5d4SDavid Howells 	unsigned long  st_rdev;
38cb8db5d4SDavid Howells #endif
39cb8db5d4SDavid Howells 	unsigned long  st_size;
40cb8db5d4SDavid Howells 	unsigned long  st_blksize;
41cb8db5d4SDavid Howells 	unsigned long  st_blocks;
42cb8db5d4SDavid Howells 	unsigned long  st_atime;
43cb8db5d4SDavid Howells 	unsigned long  st_atime_nsec;
44cb8db5d4SDavid Howells 	unsigned long  st_mtime;
45cb8db5d4SDavid Howells 	unsigned long  st_mtime_nsec;
46cb8db5d4SDavid Howells 	unsigned long  st_ctime;
47cb8db5d4SDavid Howells 	unsigned long  st_ctime_nsec;
48cb8db5d4SDavid Howells 	unsigned long  __unused4;
49cb8db5d4SDavid Howells 	unsigned long  __unused5;
50cb8db5d4SDavid Howells };
51cb8db5d4SDavid Howells 
52cb8db5d4SDavid Howells /* This matches struct stat64 in glibc2.1, hence the absolutely
53cb8db5d4SDavid Howells  * insane amounts of padding around dev_t's.
54cb8db5d4SDavid Howells  * Note: The kernel zero's the padded region because glibc might read them
55cb8db5d4SDavid Howells  * in the hope that the kernel has stretched to using larger sizes.
56cb8db5d4SDavid Howells  */
57cb8db5d4SDavid Howells struct stat64 {
58cb8db5d4SDavid Howells 	unsigned long long	st_dev;
59cb8db5d4SDavid Howells 	unsigned char   __pad0[4];
60cb8db5d4SDavid Howells 
61cb8db5d4SDavid Howells #define STAT64_HAS_BROKEN_ST_INO	1
62cb8db5d4SDavid Howells 	unsigned long	__st_ino;
63cb8db5d4SDavid Howells 	unsigned int	st_mode;
64cb8db5d4SDavid Howells 	unsigned int	st_nlink;
65cb8db5d4SDavid Howells 
66cb8db5d4SDavid Howells 	unsigned long	st_uid;
67cb8db5d4SDavid Howells 	unsigned long	st_gid;
68cb8db5d4SDavid Howells 
69cb8db5d4SDavid Howells 	unsigned long long	st_rdev;
70cb8db5d4SDavid Howells 	unsigned char   __pad3[4];
71cb8db5d4SDavid Howells 
72cb8db5d4SDavid Howells 	long long	st_size;
73cb8db5d4SDavid Howells 	unsigned long	st_blksize;
74cb8db5d4SDavid Howells 	unsigned long long st_blocks;	/* Number 512-byte blocks allocated. */
75cb8db5d4SDavid Howells 
76cb8db5d4SDavid Howells 	unsigned long	st_atime;
77cb8db5d4SDavid Howells 	unsigned long	st_atime_nsec;
78cb8db5d4SDavid Howells 
79cb8db5d4SDavid Howells 	unsigned long	st_mtime;
80cb8db5d4SDavid Howells 	unsigned long	st_mtime_nsec;
81cb8db5d4SDavid Howells 
82cb8db5d4SDavid Howells 	unsigned long	st_ctime;
83cb8db5d4SDavid Howells 	unsigned long	st_ctime_nsec;
84cb8db5d4SDavid Howells 
85cb8db5d4SDavid Howells 	unsigned long long	st_ino;
86cb8db5d4SDavid Howells };
87cb8db5d4SDavid Howells 
88cb8db5d4SDavid Howells #endif
89