4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
8 #ifndef __WINE_SYS_STAT_H
9 #define __WINE_SYS_STAT_H
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
14 #include <sys/types.h>
16 #ifndef _WCHAR_T_DEFINED
17 #define _WCHAR_T_DEFINED
19 typedef unsigned short wchar_t;
25 # define __int64 long long
29 #ifndef _DEV_T_DEFINED
30 typedef unsigned int _dev_t;
31 #define _DEV_T_DEFINED
34 #ifndef _INO_T_DEFINED
35 typedef unsigned short _ino_t;
36 #define _INO_T_DEFINED
39 #ifndef _TIME_T_DEFINED
41 #define _TIME_T_DEFINED
44 #ifndef _OFF_T_DEFINED
46 #define _OFF_T_DEFINED
49 #define _S_IEXEC 0x0040
50 #define _S_IWRITE 0x0080
51 #define _S_IREAD 0x0100
52 #define _S_IFIFO 0x1000
53 #define _S_IFCHR 0x2000
54 #define _S_IFDIR 0x4000
55 #define _S_IFREG 0x8000
56 #define _S_IFMT 0xF000
69 unsigned short st_mode;
83 unsigned short st_mode;
97 unsigned short st_mode;
107 #endif /* _STAT_DEFINED */
113 int _fstat(int,struct _stat*);
114 int _stat(const char*,struct _stat*);
115 int _fstati64(int,struct _stati64*);
116 int _stati64(const char*,struct _stati64*);
119 #ifndef _WSTAT_DEFINED
120 #define _WSTAT_DEFINED
121 int _wstat(const wchar_t*,struct _stat*);
122 int _wstati64(const wchar_t*,struct _stati64*);
123 #endif /* _WSTAT_DEFINED */
130 #define S_IFMT _S_IFMT
131 #define S_IFDIR _S_IFDIR
132 #define S_IFCHR _S_IFCHR
133 #define S_IFREG _S_IFREG
134 #define S_IREAD _S_IREAD
135 #define S_IWRITE _S_IWRITE
136 #define S_IEXEC _S_IEXEC
138 #define S_ISCHR(m) (((m)&_S_IFMT) == _S_IFCHR)
139 #define S_ISDIR(m) (((m)&_S_IFMT) == _S_IFDIR)
140 #define S_ISFIFO(m) (((m)&_S_IFMT) == _S_IFIFO)
141 #define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG)
143 static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
144 static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
145 #ifndef _UMASK_DEFINED
146 static inline int umask(int fd) { return _umask(fd); }
147 #define _UMASK_DEFINED
150 #endif /* __WINE_SYS_STAT_H */