ReactOS
0.4.16-dev-1025-gd3456f5
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
umask.cpp
Go to the documentation of this file.
1
/***
2
*umask.c - set file permission mask
3
*
4
* Copyright (c) Microsoft Corporation. All rights reserved.
5
*
6
*Purpose:
7
* defines _umask() - sets file permission mask of current process*
8
* affecting files created by creat, open, or sopen.
9
*
10
*******************************************************************************/
11
12
#include <
corecrt_internal_lowio.h
>
13
#include <sys/stat.h>
14
15
extern
"C"
{
int
_umaskval
= 0; }
16
17
/***
18
*errno_t _umask(mode, poldmode) - set the file mode mask
19
*
20
*Purpose :
21
* Works similiar to umask except it validates input params.
22
*
23
*
24
*******************************************************************************/
25
26
extern
"C"
errno_t
__cdecl
_umask_s
(
27
int
const
mode
,
28
int
*
const
old_mode
29
)
30
{
31
_VALIDATE_RETURN_ERRCODE
(old_mode !=
nullptr
,
EINVAL
);
32
*old_mode =
_umaskval
;
33
_VALIDATE_RETURN_ERRCODE
((
mode
& ~(
_S_IREAD
|
_S_IWRITE
)) == 0,
EINVAL
);
34
35
_umaskval
=
mode
;
36
return
0;
37
}
38
39
/***
40
*int _umask(mode) - set the file mode mask
41
*
42
*Purpose:
43
* Sets the file-permission mask of the current process* which
44
* modifies the permission setting of new files created by creat,
45
* open, or sopen.
46
*
47
*Entry:
48
* int mode - new file permission mask
49
* may contain _S_IWRITE, _S_IREAD, _S_IWRITE | _S_IREAD.
50
* The S_IREAD bit has no effect under Win32
51
*
52
*Exit:
53
* returns the previous setting of the file permission mask.
54
*
55
*Exceptions:
56
*
57
*******************************************************************************/
58
extern
"C"
int
__cdecl
_umask
(
int
const
mode
)
59
{
60
// Silently ignore non-Windows modes:
61
int
const
masked_mode =
mode
& (
_S_IREAD
|
_S_IWRITE
);
62
63
int
old_mode = 0;
64
_umask_s
(masked_mode, &old_mode);
65
return
old_mode;
66
}
EINVAL
#define EINVAL
Definition:
acclib.h:90
__cdecl
#define __cdecl
Definition:
accygwin.h:79
corecrt_internal_lowio.h
_S_IWRITE
#define _S_IWRITE
Definition:
cabinet.h:33
_S_IREAD
#define _S_IREAD
Definition:
cabinet.h:34
mode
GLenum mode
Definition:
glext.h:6217
_VALIDATE_RETURN_ERRCODE
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
Definition:
internal_shared.h:143
errno_t
int errno_t
Definition:
corecrt.h:615
_umask_s
errno_t __cdecl _umask_s(int const mode, int *const old_mode)
Definition:
umask.cpp:26
_umask
int __cdecl _umask(int const mode)
Definition:
umask.cpp:58
_umaskval
int _umaskval
Definition:
umask.cpp:15
sdk
lib
ucrt
lowio
umask.cpp
Generated on Tue Apr 22 2025 06:16:02 for ReactOS by
1.9.6