Fork me on GitHub

root/kernel/syscalls/umask.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. sys_umask

   1 /*
   2  * fiwix/kernel/syscalls/umask.c
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #include <fiwix/types.h>
   9 #include <fiwix/process.h>
  10 #include <fiwix/stat.h>
  11 
  12 #ifdef __DEBUG__
  13 #include <fiwix/stdio.h>
  14 #endif /*__DEBUG__ */
  15 
  16 int sys_umask(__mode_t mask)
  17 {
  18         __mode_t old_umask;
  19 
  20 #ifdef __DEBUG__
  21         printk("(pid %d) sys_umask(%d)\n", current->pid, mask);
  22 #endif /*__DEBUG__ */
  23 
  24         old_umask = current->umask;
  25         current->umask = mask & (S_IRWXU | S_IRWXG | S_IRWXO);
  26         return old_umask;
  27 }

/* [previous][next][first][last][top][bottom][index][help] */