5
Last change
on this file since 1c6926c1 was
4a3c920,
checked in by Sebastian Huber <sebastian.huber@…>, on 05/04/15 at 07:30:21
|
libcsupport: Fix umask() locking
Delete comment related to an obsolete implementation of
rtems_libio_set_private_env().
|
-
Property mode set to
100644
|
File size:
710 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Set File Creation Mask |
---|
5 | * @ingroup libcsupport |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <sys/stat.h> |
---|
22 | |
---|
23 | #include <rtems/libio_.h> |
---|
24 | |
---|
25 | /** |
---|
26 | * POSIX 1003.1b 5.3.3 - Set File Creation Mask |
---|
27 | */ |
---|
28 | mode_t umask( mode_t cmask ) |
---|
29 | { |
---|
30 | mode_t old_mask; |
---|
31 | |
---|
32 | rtems_libio_lock(); |
---|
33 | old_mask = rtems_filesystem_umask; |
---|
34 | rtems_filesystem_umask = cmask & (S_IRWXU | S_IRWXG | S_IRWXO); |
---|
35 | rtems_libio_unlock(); |
---|
36 | |
---|
37 | return old_mask; |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.