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
12#define STAT_HAVE_NSEC 1
13
14#ifndef __powerpc64__
15struct __old_kernel_stat {
16	unsigned short st_dev;
17	unsigned short st_ino;
18	unsigned short st_mode;
19	unsigned short st_nlink;
20	unsigned short st_uid;
21	unsigned short st_gid;
22	unsigned short st_rdev;
23	unsigned long  st_size;
24	unsigned long  st_atime;
25	unsigned long  st_mtime;
26	unsigned long  st_ctime;
27};
28#endif /* !__powerpc64__ */
29
30struct stat {
31	unsigned long	st_dev;
32	__kernel_ino_t	st_ino;
33#ifdef __powerpc64__
34	unsigned long	st_nlink;
35	__kernel_mode_t	st_mode;
36#else
37	__kernel_mode_t	st_mode;
38	unsigned short	st_nlink;
39#endif
40	__kernel_uid32_t st_uid;
41	__kernel_gid32_t st_gid;
42	unsigned long	st_rdev;
43	long		st_size;
44	unsigned long	st_blksize;
45	unsigned long	st_blocks;
46	unsigned long	st_atime;
47	unsigned long	st_atime_nsec;
48	unsigned long	st_mtime;
49	unsigned long	st_mtime_nsec;
50	unsigned long	st_ctime;
51	unsigned long	st_ctime_nsec;
52	unsigned long	__unused4;
53	unsigned long	__unused5;
54#ifdef __powerpc64__
55	unsigned long	__unused6;
56#endif
57};
58
59/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
60struct stat64 {
61	unsigned long long st_dev;		/* Device.  */
62	unsigned long long st_ino;		/* File serial number.  */
63	unsigned int	st_mode;	/* File mode.  */
64	unsigned int	st_nlink;	/* Link count.  */
65	unsigned int	st_uid;		/* User ID of the file's owner.  */
66	unsigned int	st_gid;		/* Group ID of the file's group. */
67	unsigned long long st_rdev;	/* Device number, if device.  */
68	unsigned short	__pad2;
69	long long	st_size;	/* Size of file, in bytes.  */
70	int		st_blksize;	/* Optimal block size for I/O.  */
71	long long	st_blocks;	/* Number 512-byte blocks allocated. */
72	int		st_atime;	/* Time of last access.  */
73	unsigned int	st_atime_nsec;
74	int		st_mtime;	/* Time of last modification.  */
75	unsigned int	st_mtime_nsec;
76	int		st_ctime;	/* Time of last status change.  */
77	unsigned int	st_ctime_nsec;
78	unsigned int	__unused4;
79	unsigned int	__unused5;
80};
81
82#endif /* _ASM_POWERPC_STAT_H */
83