ReactOS 0.4.16-dev-927-g467dec4
creat.cpp File Reference
Include dependency graph for creat.cpp:

Go to the source code of this file.

Functions

template<typename Character >
static int __cdecl common_creat (Character const *const path, int const pmode) throw ()
 
int __cdecl _creat (char const *const path, int const pmode)
 
int __cdecl _wcreat (wchar_t const *const path, int const pmode)
 

Function Documentation

◆ _creat()

int __cdecl _creat ( char const *const  path,
int const  pmode 
)

Definition at line 33 of file creat.cpp.

34{
35 return common_creat(path, pmode);
36}
static int __cdecl common_creat(Character const *const path, int const pmode)
Definition: creat.cpp:24

◆ _wcreat()

int __cdecl _wcreat ( wchar_t const *const  path,
int const  pmode 
)

Definition at line 38 of file creat.cpp.

39{
40 return common_creat(path, pmode);
41}

◆ common_creat()

template<typename Character >
static int __cdecl common_creat ( Character const *const  path,
int const  pmode 
)
throw (
)
static

Definition at line 24 of file creat.cpp.

25{
26 typedef __crt_char_traits<Character> traits;
27 // creat is just the same as open...
28 int fh = -1;
29 errno_t e = traits::tsopen_s(&fh, path, _O_CREAT + _O_TRUNC + _O_RDWR, _SH_DENYNO, pmode);
30 return e == 0 ? fh : -1;
31}
#define _SH_DENYNO
Definition: share.h:17
#define _O_RDWR
Definition: cabinet.h:39
#define _O_TRUNC
Definition: cabinet.h:47
#define _O_CREAT
Definition: cabinet.h:46
#define e
Definition: ke_i.h:82
int errno_t
Definition: corecrt.h:615

Referenced by _creat(), and _wcreat().