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
17 typedef unsigned int _dev_t
;
18 #define _DEV_T_DEFINED
21 #ifndef _INO_T_DEFINED
22 typedef unsigned short _ino_t
;
23 #define _INO_T_DEFINED
26 #ifndef _OFF_T_DEFINED
28 #define _OFF_T_DEFINED
31 #ifndef DECLSPEC_ALIGN
32 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
33 # define DECLSPEC_ALIGN(x) __declspec(align(x))
34 # elif defined(__GNUC__)
35 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
37 # define DECLSPEC_ALIGN(x)
41 #define _S_IEXEC 0x0040
42 #define _S_IWRITE 0x0080
43 #define _S_IREAD 0x0100
44 #define _S_IFIFO 0x1000
45 #define _S_IFCHR 0x2000
46 #define _S_IFDIR 0x4000
47 #define _S_IFREG 0x8000
48 #define _S_IFMT 0xF000
61 unsigned short st_mode
;
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
;
131 unsigned short st_mode
;
136 __int64
DECLSPEC_ALIGN(8) st_size
;
145 unsigned short st_mode
;
150 __int64
DECLSPEC_ALIGN(8) st_size
;
155 #endif /* _STAT_DEFINED */
161 int __cdecl
_fstat(int,struct _stat
*);
162 int __cdecl
_stat(const char*,struct _stat
*);
163 int __cdecl
_fstat32(int, struct _stat32
*);
164 int __cdecl
_stat32(const char*, struct _stat32
*);
165 int __cdecl
_fstati64(int,struct _stati64
*);
166 int __cdecl
_stati64(const char*,struct _stati64
*);
167 int __cdecl
_fstat64(int,struct _stat64
*);
168 int __cdecl
_stat64(const char*,struct _stat64
*);
169 int __cdecl
_umask(int);
171 #ifndef _WSTAT_DEFINED
172 #define _WSTAT_DEFINED
173 int __cdecl
_wstat(const wchar_t*,struct _stat
*);
174 int __cdecl
_wstat32(const wchar_t*, struct _stat32
*);
175 int __cdecl
_wstati64(const wchar_t*,struct _stati64
*);
176 int __cdecl
_wstat64(const wchar_t*,struct _stat64
*);
177 #endif /* _WSTAT_DEFINED */
184 #define S_IFMT _S_IFMT
185 #define S_IFDIR _S_IFDIR
186 #define S_IFCHR _S_IFCHR
187 #define S_IFREG _S_IFREG
188 #define S_IREAD _S_IREAD
189 #define S_IWRITE _S_IWRITE
190 #define S_IEXEC _S_IEXEC
192 static inline int fstat(int fd
, struct stat
* ptr
) { return _fstat(fd
, (struct _stat
*)ptr
); }
193 static inline int stat(const char* path
, struct stat
* ptr
) { return _stat(path
, (struct _stat
*)ptr
); }
194 #ifndef _UMASK_DEFINED
195 static inline int umask(int fd
) { return _umask(fd
); }
196 #define _UMASK_DEFINED
201 #endif /* __WINE_SYS_STAT_H */