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
16 #include <sys/types.h>
18 #ifndef _WCHAR_T_DEFINED
19 #define _WCHAR_T_DEFINED
21 typedef unsigned short wchar_t;
25 #ifndef _DEV_T_DEFINED
26 typedef unsigned int _dev_t
;
27 #define _DEV_T_DEFINED
30 #ifndef _INO_T_DEFINED
31 typedef unsigned short _ino_t
;
32 #define _INO_T_DEFINED
35 #ifndef _TIME_T_DEFINED
37 #define _TIME_T_DEFINED
40 #ifndef _OFF_T_DEFINED
42 #define _OFF_T_DEFINED
45 #ifndef DECLSPEC_ALIGN
46 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
47 # define DECLSPEC_ALIGN(x) __declspec(align(x))
48 # elif defined(__GNUC__)
49 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
51 # define DECLSPEC_ALIGN(x)
55 #define _S_IEXEC 0x0040
56 #define _S_IWRITE 0x0080
57 #define _S_IREAD 0x0100
58 #define _S_IFIFO 0x1000
59 #define _S_IFCHR 0x2000
60 #define _S_IFDIR 0x4000
61 #define _S_IFREG 0x8000
62 #define _S_IFMT 0xF000
75 unsigned short st_mode
;
89 unsigned short st_mode
;
103 unsigned short st_mode
;
108 __int64
DECLSPEC_ALIGN(8) st_size
;
117 unsigned short st_mode
;
122 __int64
DECLSPEC_ALIGN(8) st_size
;
127 #endif /* _STAT_DEFINED */
133 int _fstat(int,struct _stat
*);
134 int _stat(const char*,struct _stat
*);
135 int _fstati64(int,struct _stati64
*);
136 int _stati64(const char*,struct _stati64
*);
137 int _fstat64(int,struct _stat64
*);
138 int _stat64(const char*,struct _stat64
*);
141 #ifndef _WSTAT_DEFINED
142 #define _WSTAT_DEFINED
143 int _wstat(const wchar_t*,struct _stat
*);
144 int _wstati64(const wchar_t*,struct _stati64
*);
145 int _wstat64(const wchar_t*,struct _stat64
*);
146 #endif /* _WSTAT_DEFINED */
153 #define S_IFMT _S_IFMT
154 #define S_IFDIR _S_IFDIR
155 #define S_IFCHR _S_IFCHR
156 #define S_IFREG _S_IFREG
157 #define S_IREAD _S_IREAD
158 #define S_IWRITE _S_IWRITE
159 #define S_IEXEC _S_IEXEC
161 static inline int fstat(int fd
, struct stat
* ptr
) { return _fstat(fd
, (struct _stat
*)ptr
); }
162 static inline int stat(const char* path
, struct stat
* ptr
) { return _stat(path
, (struct _stat
*)ptr
); }
163 #ifndef _UMASK_DEFINED
164 static inline int umask(int fd
) { return _umask(fd
); }
165 #define _UMASK_DEFINED
170 #endif /* __WINE_SYS_STAT_H */