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 <syscalls.h> 11 #include <umask.h> 12 13 14 mode_t __gUmask = 022; 15 // this must be made available to open() and friends 16 17 18 mode_t 19 umask(mode_t newMask) 20 { 21 mode_t oldMask = __gUmask; 22 __gUmask = newMask; 23 24 return oldMask; 25 } 26 27