#pragma once
#include <corecrt.h>
#include <sys/types.h>
_CRT_BEGIN_C_HEADER
__pragma
(pack(push,
8
))
extern
"C"
{
#pragma warning(push)
#pragma warning(disable: 4820) /* padding added after data member */
#pragma warning(disable:
4820
)
struct
{
;
;
unsigned
short
;
short
;
short
;
short
;
;
;
;
;
;
};
struct
{
;
;
unsigned
short
;
short
;
short
;
short
;
;
__int64
;
;
;
;
};
struct
{
;
;
unsigned
short
;
short
;
short
;
short
;
;
;
;
;
;
};
struct
{
;
;
unsigned
short
;
short
;
short
;
short
;
;
__int64
;
;
;
;
};
#define __stat64 _stat64 // For legacy compatibility
#if _CRT_INTERNAL_NONSTDC_NAMES && !defined _CRT_NO_TIME_T
struct
{
;
;
unsigned
short
;
short
;
short
;
short
;
;
;
;
;
;
};
#endif
#define _S_IFMT 0xF000 // File type mask
#define _S_IFDIR 0x4000 // Directory
#define _S_IFCHR 0x2000 // Character special
#define _S_IFIFO 0x1000 // Pipe
#define _S_IFREG 0x8000 // Regular
#define _S_IREAD 0x0100 // Read permission, owner
#define _S_IWRITE 0x0080 // Write permission, owner
#define _S_IEXEC 0x0040 // Execute/search permission, owner
#if _CRT_INTERNAL_NONSTDC_NAMES
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFCHR _S_IFCHR
#define S_IFREG _S_IFREG
#define S_IREAD _S_IREAD
#define S_IWRITE _S_IWRITE
#define S_IEXEC _S_IEXEC
#endif
#ifdef _USE_32BIT_TIME_T
#define _fstat _fstat32
#define _fstati64 _fstat32i64
#define _stat _stat32
#define _stati64 _stat32i64
#define _wstat _wstat32
#define _wstati64 _wstat32i64
#else
#define _fstat _fstat64i32
#define _fstati64 _fstat64
#define _stat _stat64i32
#define _stati64 _stat64
#define _wstat _wstat64i32
#define _wstati64 _wstat64
#endif
_ACRTIMP int __cdecl _fstat32(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _stat32* _Stat
);
_ACRTIMP int __cdecl _fstat32i64(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _stat32i64* _Stat
);
_ACRTIMP int __cdecl _fstat64i32(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _stat64i32* _Stat
);
_ACRTIMP int __cdecl _fstat64(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _stat64* _Stat
);
_ACRTIMP int __cdecl _stat32(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ char const* _FileName,
_Out_ struct _stat32* _Stat
);
_ACRTIMP int __cdecl _stat32i64(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ char const* _FileName,
_Out_ struct _stat32i64* _Stat
);
_ACRTIMP int __cdecl _stat64i32(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ char const* _FileName,
_Out_ struct _stat64i32* _Stat
);
_ACRTIMP int __cdecl _stat64(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ char const* _FileName,
_Out_ struct _stat64* _Stat
);
_ACRTIMP int __cdecl _wstat32(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ wchar_t const* _FileName,
_Out_ struct _stat32* _Stat
);
_ACRTIMP int __cdecl _wstat32i64(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ wchar_t const* _FileName,
_Out_ struct _stat32i64* _Stat
);
_ACRTIMP int __cdecl _wstat64i32(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ wchar_t const* _FileName,
_Out_ struct _stat64i32* _Stat
);
_ACRTIMP int __cdecl _wstat64(
__declspec
(dllimport)
int
__cdecl
(
_In_z_ wchar_t const* _FileName,
_Out_ struct _stat64* _Stat
);
#if !defined RC_INVOKED && !defined __midl && _CRT_INTERNAL_NONSTDC_NAMES && !defined _CRT_NO_TIME_T
#ifdef _USE_32BIT_TIME_T
static __inline int __CRTDECL fstat(int const _FileHandle, struct stat* const _Stat)
{
_STATIC_ASSERT(sizeof(struct stat) == sizeof(struct _stat32));
return _fstat32(_FileHandle, (struct _stat32*)_Stat);
}
static __inline int __CRTDECL stat(char const* const _FileName, struct stat* const _Stat)
{
_STATIC_ASSERT(sizeof(struct stat) == sizeof(struct _stat32));
return _stat32(_FileName, (struct _stat32*)_Stat);
}
#else
static __inline int __CRTDECL fstat(int const _FileHandle, struct stat* const _Stat)
static
__inline
int
__cdecl
(
int
const
,
struct
*
const
)
{
_STATIC_ASSERT(sizeof(struct stat) == sizeof(struct _stat64i32));
typedef
char
[(
sizeof
(
struct
) ==
sizeof
(
struct
)) !=
0
];
return
(
, (
struct
*)
);
}
static __inline int __CRTDECL stat(char const* const _FileName, struct stat* const _Stat)
static
__inline
int
__cdecl
(
char
const
*
const
,
struct
*
const
)
{
_STATIC_ASSERT(sizeof(struct stat) == sizeof(struct _stat64i32));
typedef
char
[(
sizeof
(
struct
) ==
sizeof
(
struct
)) !=
0
];
return
(
, (
struct
*)
);
}
#endif
#endif
#pragma warning(pop)