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 #define __WINE_USE_MSVCRT
12 #include "sys/types.h"
15 # ifdef USE_MSVCRT_PREFIX
16 # define MSVCRT(x) MSVCRT_##x
22 #ifndef MSVCRT_WCHAR_T_DEFINED
23 #define MSVCRT_WCHAR_T_DEFINED
25 typedef unsigned short MSVCRT(wchar_t);
31 # define __int64 long long
35 #ifndef MSVCRT_DEV_T_DEFINED
36 typedef unsigned int _dev_t
;
37 #define MSVCRT_DEV_T_DEFINED
40 #ifndef MSVCRT_INO_T_DEFINED
41 typedef unsigned short _ino_t
;
42 #define MSVCRT_INO_T_DEFINED
45 #ifndef MSVCRT_TIME_T_DEFINED
46 typedef long MSVCRT(time_t);
47 #define MSVCRT_TIME_T_DEFINED
50 #ifndef MSVCRT_OFF_T_DEFINED
51 typedef int MSVCRT(_off_t
);
52 #define MSVCRT_OFF_T_DEFINED
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
69 #ifndef MSVCRT_STAT_DEFINED
70 #define MSVCRT_STAT_DEFINED
75 unsigned short st_mode
;
80 MSVCRT(_off_t
) st_size
;
81 MSVCRT(time_t) st_atime
;
82 MSVCRT(time_t) st_mtime
;
83 MSVCRT(time_t) st_ctime
;
89 unsigned short st_mode
;
95 MSVCRT(time_t) st_atime
;
96 MSVCRT(time_t) st_mtime
;
97 MSVCRT(time_t) st_ctime
;
99 #endif /* MSVCRT_STAT_DEFINED */
105 int MSVCRT(_fstat
)(int,struct _stat
*);
106 int MSVCRT(_stat
)(const char*,struct _stat
*);
107 int _fstati64(int,struct _stati64
*);
108 int _stati64(const char*,struct _stati64
*);
111 #ifndef MSVCRT_WSTAT_DEFINED
112 #define MSVCRT_WSTAT_DEFINED
113 int _wstat(const MSVCRT(wchar_t)*,struct _stat
*);
114 int _wstati64(const MSVCRT(wchar_t)*,struct _stati64
*);
115 #endif /* MSVCRT_WSTAT_DEFINED */
122 #ifndef USE_MSVCRT_PREFIX
123 #define S_IFMT _S_IFMT
124 #define S_IFDIR _S_IFDIR
125 #define S_IFCHR _S_IFCHR
126 #define S_IFREG _S_IFREG
127 #define S_IREAD _S_IREAD
128 #define S_IWRITE _S_IWRITE
129 #define S_IEXEC _S_IEXEC
131 static inline int fstat(int fd
, struct _stat
* ptr
) { return _fstat(fd
, ptr
); }
132 static inline int stat(const char* path
, struct _stat
* ptr
) { return _stat(path
, ptr
); }
133 #ifndef MSVCRT_UMASK_DEFINED
134 static inline int umask(int fd
) { return _umask(fd
); }
135 #define MSVCRT_UMASK_DEFINED
137 #endif /* USE_MSVCRT_PREFIX */
139 #endif /* __WINE_SYS_STAT_H */