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
12 #include <sys/types.h>
16 #ifndef _DEV_T_DEFINED
18 typedef unsigned short _dev_t
;
20 typedef unsigned int _dev_t
;
22 #define _DEV_T_DEFINED
25 #ifndef _INO_T_DEFINED
26 typedef unsigned short _ino_t
;
27 #define _INO_T_DEFINED
30 #ifndef _OFF_T_DEFINED
32 #define _OFF_T_DEFINED
35 #ifndef DECLSPEC_ALIGN
36 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
37 # define DECLSPEC_ALIGN(x) __declspec(align(x))
38 # elif defined(__GNUC__)
39 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
41 # define DECLSPEC_ALIGN(x)
45 #define _S_IEXEC 0x0040
46 #define _S_IWRITE 0x0080
47 #define _S_IREAD 0x0100
48 #define _S_IFIFO 0x1000
49 #define _S_IFCHR 0x2000
50 #define _S_IFDIR 0x4000
51 #define _S_IFREG 0x8000
52 #define _S_IFMT 0xF000
65 unsigned short st_mode
;
79 unsigned short st_mode
;
93 unsigned short st_mode
;
107 unsigned short st_mode
;
112 __int64
DECLSPEC_ALIGN(8) st_size
;
121 unsigned short st_mode
;
135 unsigned short st_mode
;
140 __int64
DECLSPEC_ALIGN(8) st_size
;
149 unsigned short st_mode
;
154 __int64
DECLSPEC_ALIGN(8) st_size
;
159 #endif /* _STAT_DEFINED */
166 # ifdef _USE_32BIT_TIME_T
167 # define _fstat _fstat32
168 # define _fstati64 _fstat32i64
169 # define _stat _stat32
170 # define _stati64 _stat32i64
171 # define _wstat _wstat32
172 # define _wstati64 _wstat32i64
174 # define _fstat _fstat64i32
175 # define _fstati64 _fstat64
176 # define _stat _stat64i32
177 # define _stati64 _stat64
178 # define _wstat _wstat64i32
179 # define _wstati64 _wstat64
182 # ifdef _USE_32BIT_TIME_T
183 # define _fstat32 _fstat
184 # define _fstat32i64 _fstati64
185 # define _stat32i64 _stati64
186 # define _stat32 _stat
187 # define _wstat32 _wstat
188 # define _wstat32i64 _wstati64
190 # define _fstat64i32 _fstat
191 # define _fstat64 _fstati64
192 # define _stat64 _stati64
193 # define _stat64i32 _stat
194 # define _wstat64i32 _wstat
195 # define _wstat64 _wstati64
199 _ACRTIMP
int __cdecl
_fstat32(int, struct _stat32
*);
200 _ACRTIMP
int __cdecl
_fstat32i64(int, struct _stat32i64
*);
201 _ACRTIMP
int __cdecl
_fstat64(int,struct _stat64
*);
202 _ACRTIMP
int __cdecl
_fstat64i32(int,struct _stat64i32
*);
203 _ACRTIMP
int __cdecl
_stat32(const char*, struct _stat32
*);
204 _ACRTIMP
int __cdecl
_stat32i64(const char*, struct _stat32i64
*);
205 _ACRTIMP
int __cdecl
_stat64(const char*,struct _stat64
*);
206 _ACRTIMP
int __cdecl
_stat64i32(const char*,struct _stat64i32
*);
207 _ACRTIMP
int __cdecl
_umask(int);
208 _ACRTIMP
int __cdecl
_wstat32(const wchar_t*,struct _stat32
*);
209 _ACRTIMP
int __cdecl
_wstat32i64(const wchar_t*, struct _stat32i64
*);
210 _ACRTIMP
int __cdecl
_wstat64(const wchar_t*,struct _stat64
*);
211 _ACRTIMP
int __cdecl
_wstat64i32(const wchar_t*,struct _stat64i32
*);
218 #define S_IFMT _S_IFMT
219 #define S_IFDIR _S_IFDIR
220 #define S_IFCHR _S_IFCHR
221 #define S_IFREG _S_IFREG
222 #define S_IREAD _S_IREAD
223 #define S_IWRITE _S_IWRITE
224 #define S_IEXEC _S_IEXEC
226 static inline int fstat(int fd
, struct stat
* ptr
) { return _fstat(fd
, (struct _stat
*)ptr
); }
227 static inline int stat(const char* path
, struct stat
* ptr
) { return _stat(path
, (struct _stat
*)ptr
); }
228 #ifndef _UMASK_DEFINED
229 static inline int umask(int fd
) { return _umask(fd
); }
230 #define _UMASK_DEFINED
235 #endif /* __WINE_SYS_STAT_H */