ReactOS
0.4.16-dev-927-g467dec4
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
creat.cpp
Go to the documentation of this file.
1
//
2
// creat.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// Defines _creat() (and _wcreat(), via inclusion), which creates a new file.
7
//
8
#include <
corecrt_internal_lowio.h
>
9
10
11
12
// Creates a new file.
13
//
14
// If the file does not exist, this function creates a new file with the given
15
// permission setting and opens it for writing. If the file already exists and
16
// its permission allows writing, this function truncates it to zero length and
17
// opens it for writing.
18
//
19
// The only XENIX mode bit supported is user write (S_IWRITE).
20
//
21
// On success, the handle for the newly created file is returned. On failure,
22
// -1 is returned and errno is set.
23
template
<
typename
Character>
24
static
int
__cdecl
common_creat
(Character
const
*
const
path
,
int
const
pmode)
throw
()
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
}
32
33
extern
"C"
int
__cdecl
_creat
(
char
const
*
const
path
,
int
const
pmode)
34
{
35
return
common_creat
(
path
, pmode);
36
}
37
38
extern
"C"
int
__cdecl
_wcreat
(
wchar_t
const
*
const
path
,
int
const
pmode)
39
{
40
return
common_creat
(
path
, pmode);
41
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
corecrt_internal_lowio.h
common_creat
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:
creat.cpp:38
_creat
int __cdecl _creat(char const *const path, int const pmode)
Definition:
creat.cpp:33
_SH_DENYNO
#define _SH_DENYNO
Definition:
share.h:17
_O_RDWR
#define _O_RDWR
Definition:
cabinet.h:39
_O_TRUNC
#define _O_TRUNC
Definition:
cabinet.h:47
_O_CREAT
#define _O_CREAT
Definition:
cabinet.h:46
e
#define e
Definition:
ke_i.h:82
__crt_char_traits
Definition:
corecrt_internal_traits.h:70
path
Definition:
wbemprox_private.h:188
errno_t
int errno_t
Definition:
corecrt.h:615
sdk
lib
ucrt
lowio
creat.cpp
Generated on Sun Mar 30 2025 06:14:51 for ReactOS by
1.9.6