vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / sys / umask.c
blob0ec1d299e3e8bba494a44749910102522664674f
1 /*
2 * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <sys/stat.h>
8 #include <errno.h>
10 #include <errno_private.h>
11 #include <syscalls.h>
12 #include <umask.h>
15 mode_t __gUmask = 022;
16 // this must be made available to open() and friends
19 mode_t
20 umask(mode_t newMask)
22 mode_t oldMask = __gUmask;
23 __gUmask = newMask;
25 return oldMask;