93691
|
1 /*
|
|
2 * sys/stat.h supplied with MSVCRT uses too narrow data types for
|
|
3 * inode and user/group id, so we replace them with our own.
|
|
4 */
|
|
5
|
|
6 #ifndef INC_SYS_STAT_H_
|
|
7 #define INC_SYS_STAT_H_
|
|
8
|
|
9 #ifdef __MINGW32__
|
|
10 # include <_mingw.h>
|
|
11 #else
|
|
12 # define __MINGW_NOTHROW
|
|
13 #endif
|
|
14
|
|
15 #include <sys/types.h>
|
|
16 #include <time.h>
|
|
17
|
|
18 #define S_IFMT 0xF000
|
|
19
|
|
20 #define S_IFREG 0x8000
|
|
21 #define S_IFDIR 0x4000
|
|
22 #define S_IFBLK 0x3000
|
|
23 #define S_IFCHR 0x2000
|
|
24 #define S_IFIFO 0x1000
|
|
25
|
|
26 #define S_IREAD 0x0100
|
|
27 #define S_IWRITE 0x0080
|
|
28 #define S_IEXEC 0x0040
|
|
29
|
|
30 #define S_IRUSR S_IREAD
|
|
31 #define S_IWUSR S_IWRITE
|
|
32 #define S_IXUSR S_IEXEC
|
|
33 #define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
|
|
34
|
|
35 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
|
36 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
|
37 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
|
38 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
|
39 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
|
40
|
|
41 struct stat {
|
|
42 dev_t st_dev;
|
|
43 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
|
|
44 unsigned short st_mode;
|
|
45 short st_nlink;
|
|
46 int st_uid;
|
|
47 int st_gid;
|
|
48 dev_t st_rdev;
|
|
49 off_t st_size;
|
|
50 time_t st_atime;
|
|
51 time_t st_mtime;
|
|
52 time_t st_ctime;
|
|
53 };
|
|
54
|
|
55 _CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*);
|
|
56 _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
|
|
57 _CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
|
|
58
|
|
59 #endif /* INC_SYS_STAT_H_ */
|
93729
|
60
|
|
61 /* arch-tag: 17d8fc06-f2e5-4d10-a01e-af819918fe42
|
|
62 (do not change this comment) */
|