ReactOS 0.4.16-dev-297-gc569aee
stat.c
Go to the documentation of this file.
1#include <precomp.h>
2#include <tchar.h>
3
4#define stat64_to_stat(buf64, buf) \
5 do { \
6 buf->st_dev = (buf64)->st_dev; \
7 buf->st_ino = (buf64)->st_ino; \
8 buf->st_mode = (buf64)->st_mode; \
9 buf->st_nlink = (buf64)->st_nlink; \
10 buf->st_uid = (buf64)->st_uid; \
11 buf->st_gid = (buf64)->st_gid; \
12 buf->st_rdev = (buf64)->st_rdev; \
13 buf->st_size = (_off_t)(buf64)->st_size; \
14 buf->st_atime = (time_t)(buf64)->st_atime; \
15 buf->st_mtime = (time_t)(buf64)->st_mtime; \
16 buf->st_ctime = (time_t)(buf64)->st_ctime; \
17 } while (0)
18
19int CDECL _tstat(const _TCHAR* path, struct _stat * buf)
20{
21 int ret;
22 struct __stat64 buf64;
23
24 ret = _tstat64(path, &buf64);
25 if (!ret)
26 stat64_to_stat(&buf64, buf);
27 return ret;
28}
29
30int CDECL _tstati64(const _TCHAR* path, struct _stati64 * buf)
31{
32 int ret;
33 struct __stat64 buf64;
34
35 ret = _tstat64(path, &buf64);
36 if (!ret)
37 stat64_to_stat(&buf64, buf);
38 return ret;
39}
40
41#ifndef _UNICODE
42
43int CDECL _fstat(int fd, struct _stat* buf)
44{ int ret;
45 struct __stat64 buf64;
46
47 ret = _fstat64(fd, &buf64);
48 if (!ret)
49 stat64_to_stat(&buf64, buf);
50 return ret;
51}
52
53int CDECL _fstati64(int fd, struct _stati64* buf)
54{
55 int ret;
56 struct __stat64 buf64;
57
58 ret = _fstat64(fd, &buf64);
59 if (!ret)
60 stat64_to_stat(&buf64, buf);
61 return ret;
62}
63
64#endif
#define CDECL
Definition: compat.h:29
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define __stat64
Definition: stat.h:129
#define _tstati64
Definition: tchar.h:749
#define _tstat
Definition: tchar.h:744
char _TCHAR
Definition: tchar.h:1392
#define _tstat64
Definition: tchar.h:747
#define stat64_to_stat(buf64, buf)
Definition: stat.c:4
int CDECL _fstat(int fd, struct _stat *buf)
Definition: stat.c:43
int CDECL _fstati64(int fd, struct _stati64 *buf)
Definition: stat.c:53
static int fd
Definition: io.c:51
int CDECL _fstat64(int fd, struct __stat64 *buf)
Definition: stat64.c:102
Definition: stat.h:40
int ret