mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
15 lines
265 B
C
15 lines
265 B
C
#include <kernel/syscalls.h>
|
|
#include <arch/cpu.h>
|
|
|
|
syscallret_t syscall_umask(context_t *, mode_t mode) {
|
|
syscallret_t ret = {
|
|
.errno = 0
|
|
};
|
|
|
|
mode &= 0777;
|
|
|
|
ret.ret = __atomic_exchange_n(&_cpu()->thread->proc->umask, mode, __ATOMIC_SEQ_CST);
|
|
|
|
return ret;
|
|
}
|