source: rtems/cpukit/libcsupport/src/umask.c @ da154e14

4.115
Last change on this file since da154e14 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 792 bytes
Line 
1/*
2 *  umask() - POSIX 1003.1b 5.3.3 - Set File Creation Mask
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13  #include "config.h"
14#endif
15
16#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
17
18#include <sys/stat.h>
19
20#include <rtems/libio_.h>
21
22mode_t umask( mode_t cmask )
23{
24  mode_t old_mask;
25
26  /*
27   * We must use the same protection mechanism as in
28   * rtems_libio_set_private_env().
29   */
30  _Thread_Disable_dispatch();
31  old_mask = rtems_filesystem_umask;
32  rtems_filesystem_umask = cmask & (S_IRWXU | S_IRWXG | S_IRWXO);
33  _Thread_Enable_dispatch();
34
35  return old_mask;
36}
Note: See TracBrowser for help on using the repository browser.