4 #include <linux/types.h>
10 #define S_IFMT 00170000 /* type of file */
11 #define S_IFSOCK 0140000 /* named socket */
12 #define S_IFLNK 0120000 /* symbolic link */
13 #define S_IFREG 0100000 /* regular */
14 #define S_IFBLK 0060000 /* block special */
15 #define S_IFDIR 0040000 /* directory */
16 #define S_IFCHR 0020000 /* character special */
17 #define S_IFIFO 0010000 /* fifo */
18 #define S_ISUID 0004000 /* set user id on execution */
19 #define S_ISGID 0002000 /* set group id on execution */
20 #define S_ISVTX 0001000 /* save swapped text even after use */
22 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
23 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
24 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
25 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
26 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
27 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
28 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
30 #define S_IRWXU 00700 /* rwx for owner */
31 #define S_IRUSR 00400 /* read permission for owner */
32 #define S_IWUSR 00200 /* write permission for owner */
33 #define S_IXUSR 00100 /* execute/search permission for owner */
35 #define S_IRWXG 00070 /* rwx for group */
36 #define S_IRGRP 00040 /* read permission for group */
37 #define S_IWGRP 00020 /* write permission for group */
38 #define S_IXGRP 00010 /* execute/search permission for group */
40 #define S_IRWXO 00007 /* rwx for other */
41 #define S_IROTH 00004 /* read permission for other */
42 #define S_IWOTH 00002 /* read permission for other */
43 #define S_IXOTH 00001 /* execute/search permission for other */
48 dev_t st_dev; /* file system id */
49 ino_t st_ino; /* file id */
50 mode_t st_mode; /* ownership/protection */
51 nlink_t st_nlink; /* number of links */
52 uid_t st_uid; /* user id */
53 gid_t st_gid; /* group id */
55 off_t st_size; /* file size in # of bytes */
56 unsigned long st_blksize; /* block size */
57 unsigned long st_blocks; /* file size in # of blocks */
58 unsigned long st_atime; /* time file was last accessed */
59 unsigned long __unused1;
60 unsigned long st_mtime; /* time file was last modified */
61 unsigned long __unused2;
62 unsigned long st_ctime; /* time file status was last changed */
63 unsigned long __unused3;
64 unsigned long __unused4;
65 unsigned long __unused5;
70 #if defined (__ARM__) || defined (__I386__)
73 unsigned short st_dev;
74 unsigned short __pad1;
76 unsigned short st_mode;
77 unsigned short st_nlink;
78 unsigned short st_uid;
79 unsigned short st_gid;
80 unsigned short st_rdev;
81 unsigned short __pad2;
82 unsigned long st_size;
83 unsigned long st_blksize;
84 unsigned long st_blocks;
85 unsigned long st_atime;
86 unsigned long __unused1;
87 unsigned long st_mtime;
88 unsigned long __unused2;
89 unsigned long st_ctime;
90 unsigned long __unused3;
91 unsigned long __unused4;
92 unsigned long __unused5;
97 #if defined (__MIPS__)
112 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
113 * but we don't have it under Linux.
126 #endif /* __MIPS__ */