1 /* 2 * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <sys/stat.h> 8 #include <errno.h> 9 10 #include <errno_private.h> 11 #include <syscalls.h> 12 #include <umask.h> 13 14 15 mode_t __gUmask = 022; 16 // this must be made available to open() and friends 17 18 19 mode_t 20 umask(mode_t newMask) 21 { 22 mode_t oldMask = __gUmask; 23 __gUmask = newMask; 24 25 return oldMask; 26 } 27 28