~sircmpwn/hare

ref: 9152cf6099b68bb2c3786a076bc6e16bc4423ea3 hare/unix/+linux/umask.ha -rw-r--r-- 317 bytes
9152cf60Umar Getagazov fs, unix::umask: don't clear file mode bits 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
use errors;
use fs;
use rt;

// Sets the file mode creation mask for the current process and return the
// previous value of the mask.
export fn umask(mode: fs::mode) (fs::mode | errors::error) = {
	return match (rt::umask(mode)) {
		mode: rt::mode_t => mode: fs::mode,
		err: rt::errno => errors::errno(err),
	};
};