blob: bd8cad21998e0e41ac88435b55ae9f3d275c0283 [file] [log] [blame]
Arnd Bergmann6103ec52009-05-13 22:56:27 +00001#ifndef __ASM_GENERIC_STAT_H
2#define __ASM_GENERIC_STAT_H
3
4/*
5 * Everybody gets this wrong and has to stick with it for all
6 * eternity. Hopefully, this version gets used by new architectures
7 * so they don't fall into the same traps.
8 *
9 * stat64 is copied from powerpc64, with explicit padding added.
10 * stat is the same structure layout on 64-bit, without the 'long long'
11 * types.
12 *
13 * By convention, 64 bit architectures use the stat interface, while
14 * 32 bit architectures use the stat64 interface. Note that we don't
15 * provide an __old_kernel_stat here, which new architecture should
16 * not have to start with.
17 */
18
19#include <asm/bitsperlong.h>
20
21#define STAT_HAVE_NSEC 1
22
23struct stat {
24 unsigned long st_dev; /* Device. */
25 unsigned long st_ino; /* File serial number. */
26 unsigned int st_mode; /* File mode. */
27 unsigned int st_nlink; /* Link count. */
28 unsigned int st_uid; /* User ID of the file's owner. */
29 unsigned int st_gid; /* Group ID of the file's group. */
30 unsigned long st_rdev; /* Device number, if device. */
31 unsigned long __pad1;
32 long st_size; /* Size of file, in bytes. */
33 int st_blksize; /* Optimal block size for I/O. */
34 int __pad2;
35 long st_blocks; /* Number 512-byte blocks allocated. */
Chris Metcalf2c7387e2010-10-28 16:07:07 -040036 long st_atime; /* Time of last access. */
37 unsigned long st_atime_nsec;
38 long st_mtime; /* Time of last modification. */
39 unsigned long st_mtime_nsec;
40 long st_ctime; /* Time of last status change. */
41 unsigned long st_ctime_nsec;
Arnd Bergmann6103ec52009-05-13 22:56:27 +000042 unsigned int __unused4;
43 unsigned int __unused5;
44};
45
Arnd Bergmann6103ec52009-05-13 22:56:27 +000046/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
Chris Metcalf2c7387e2010-10-28 16:07:07 -040047#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
Arnd Bergmann6103ec52009-05-13 22:56:27 +000048struct stat64 {
49 unsigned long long st_dev; /* Device. */
50 unsigned long long st_ino; /* File serial number. */
51 unsigned int st_mode; /* File mode. */
52 unsigned int st_nlink; /* Link count. */
53 unsigned int st_uid; /* User ID of the file's owner. */
54 unsigned int st_gid; /* Group ID of the file's group. */
55 unsigned long long st_rdev; /* Device number, if device. */
56 unsigned long long __pad1;
57 long long st_size; /* Size of file, in bytes. */
58 int st_blksize; /* Optimal block size for I/O. */
59 int __pad2;
60 long long st_blocks; /* Number 512-byte blocks allocated. */
61 int st_atime; /* Time of last access. */
62 unsigned int st_atime_nsec;
63 int st_mtime; /* Time of last modification. */
64 unsigned int st_mtime_nsec;
65 int st_ctime; /* Time of last status change. */
66 unsigned int st_ctime_nsec;
67 unsigned int __unused4;
68 unsigned int __unused5;
69};
70#endif
71
72#endif /* __ASM_GENERIC_STAT_H */