diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-05-13 18:56:27 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe2.(none)> | 2009-06-11 15:02:15 -0400 |
commit | 6103ec56c65c33774c7c38652c8204120c3c7519 (patch) | |
tree | 5d510da8f5aeb46b796a27192b04eec99d375886 /include/asm-generic/stat.h | |
parent | 2864d32be31a20a4617e37a857dd9915a57e2efb (diff) |
asm-generic: add generic ABI headers
These header files are typically copied from an existing architecture
into any new one, slightly modified and then remain untouched until
the end of time in the name of ABI stability.
To make it easier for future architectures, provide a sane generic
version here. In cases where multiple architectures already use
identical code, I used the most common version. In cases like
stat.h that are more or less broken everywhere, I provide a
version that is meant to be ideal for new architectures.
Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic/stat.h')
-rw-r--r-- | include/asm-generic/stat.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/include/asm-generic/stat.h b/include/asm-generic/stat.h new file mode 100644 index 000000000000..47e64170305d --- /dev/null +++ b/include/asm-generic/stat.h | |||
@@ -0,0 +1,72 @@ | |||
1 | #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 | |||
23 | struct 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. */ | ||
36 | int st_atime; /* Time of last access. */ | ||
37 | unsigned int st_atime_nsec; | ||
38 | int st_mtime; /* Time of last modification. */ | ||
39 | unsigned int st_mtime_nsec; | ||
40 | int st_ctime; /* Time of last status change. */ | ||
41 | unsigned int st_ctime_nsec; | ||
42 | unsigned int __unused4; | ||
43 | unsigned int __unused5; | ||
44 | }; | ||
45 | |||
46 | #if __BITS_PER_LONG != 64 | ||
47 | /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ | ||
48 | struct 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 */ | ||