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;
94 __int64 DECLSPEC_ALIGN(8) st_size;
103 unsigned short st_mode;
117 unsigned short st_mode;
122 __int64 DECLSPEC_ALIGN(8) st_size;
131 unsigned short st_mode;
136 __int64 DECLSPEC_ALIGN(8) st_size;
141 #endif /* _STAT_DEFINED */
147 int __cdecl _fstat(int,struct _stat*);
148 int __cdecl _stat(const char*,struct _stat*);
149 int __cdecl _fstati64(int,struct _stati64*);
150 int __cdecl _stati64(const char*,struct _stati64*);
151 int __cdecl _fstat64(int,struct _stat64*);
152 int __cdecl _stat64(const char*,struct _stat64*);
153 int __cdecl _umask(int);
155 #ifndef _WSTAT_DEFINED
156 #define _WSTAT_DEFINED
157 int __cdecl _wstat(const wchar_t*,struct _stat*);
158 int __cdecl _wstati64(const wchar_t*,struct _stati64*);
159 int __cdecl _wstat64(const wchar_t*,struct _stat64*);
160 #endif /* _WSTAT_DEFINED */
167 #define S_IFMT _S_IFMT
168 #define S_IFDIR _S_IFDIR
169 #define S_IFCHR _S_IFCHR
170 #define S_IFREG _S_IFREG
171 #define S_IREAD _S_IREAD
172 #define S_IWRITE _S_IWRITE
173 #define S_IEXEC _S_IEXEC
175 static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
176 static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
177 #ifndef _UMASK_DEFINED
178 static inline int umask(int fd) { return _umask(fd); }
179 #define _UMASK_DEFINED
184 #endif /* __WINE_SYS_STAT_H */