OSDN Git Service

Split out the definition of struct stat into the new arch
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / sh / bits / kernel_stat.h
1 #ifndef _BITS_STAT_STRUCT_H
2 #define _BITS_STAT_STRUCT_H
3
4 /* This file provides whatever this particular arch's kernel thinks 
5  * struct stat should look like...  It turns out each arch has a 
6  * different opinion on the subject... */
7 #include <endian.h>
8
9 struct stat {
10         unsigned short st_dev;
11         unsigned short __pad1;
12         unsigned long st_ino;
13         unsigned short st_mode;
14         unsigned short st_nlink;
15         unsigned short st_uid;
16         unsigned short st_gid;
17         unsigned short st_rdev;
18         unsigned short __pad2;
19         unsigned long  st_size;
20         unsigned long  st_blksize;
21         unsigned long  st_blocks;
22         unsigned long  st_atime;
23         unsigned long  __unused1;
24         unsigned long  st_mtime;
25         unsigned long  __unused2;
26         unsigned long  st_ctime;
27         unsigned long  __unused3;
28         unsigned long  __unused4;
29         unsigned long  __unused5;
30 };
31 #ifdef __USE_LARGEFILE64
32 struct stat64 {
33 #if defined(__BIG_ENDIAN__)
34         unsigned char   __pad0b[6];
35         unsigned short  st_dev;
36 #elif defined(__LITTLE_ENDIAN__)
37         unsigned short  st_dev;
38         unsigned char   __pad0b[6];
39 #else
40 #error Must know endian to build stat64 structure!
41 #endif
42         unsigned char   __pad0[4];
43
44         unsigned long   st_ino;
45         unsigned int    st_mode;
46         unsigned int    st_nlink;
47
48         unsigned long   st_uid;
49         unsigned long   st_gid;
50
51 #if defined(__BIG_ENDIAN__)
52         unsigned char   __pad3b[6];
53         unsigned short  st_rdev;
54 #else /* Must be little */
55         unsigned short  st_rdev;
56         unsigned char   __pad3b[6];
57 #endif
58         unsigned char   __pad3[4];
59
60         long long       st_size;
61         unsigned long   st_blksize;
62
63 #if defined(__BIG_ENDIAN__)
64         unsigned long   __pad4;         /* Future possible st_blocks hi bits */
65         unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
66 #else /* Must be little */
67         unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
68         unsigned long   __pad4;         /* Future possible st_blocks hi bits */
69 #endif
70
71         unsigned long   st_atime;
72         unsigned long   __pad5;
73
74         unsigned long   st_mtime;
75         unsigned long   __pad6;
76
77         unsigned long   st_ctime;
78         unsigned long   __pad7;         /* will be high 32 bits of ctime someday */
79
80         unsigned long   __unused1;
81         unsigned long   __unused2;
82 };
83 #endif
84
85
86 #endif  /*  _BITS_STAT_STRUCT_H */
87