4.104.114.84.95
Last change
on this file since 2a929cc was
2a929cc,
checked in by Joel Sherrill <joel.sherrill@…>, on 01/25/01 at 15:59:58
|
2001-01-25 Fernando Ruiz <fernando.ruiz@…>
- Alternate email is correo@…
- libc/privateenv.c: New file.
- include/rtems/libio_.h, libc/Makefile.am, libc/base_fs.c,
libc/unmount.c: Moved default umask, current working directory,
root, and links followed count into a structure "user environment"
that can then be treated as a unit. This enable giving unique
copies of these to individual threads or collection of threads.
|
-
Property mode set to
100644
|
File size:
933 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Instantatiate a private user environment for the calling thread. |
---|
3 | * |
---|
4 | * Submitted by: fernando.ruiz@ctv.es (correo@fernando-ruiz.com) |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-2000. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #if HAVE_CONFIG_H |
---|
17 | #include "config.h" |
---|
18 | #endif |
---|
19 | |
---|
20 | #include <rtems.h> |
---|
21 | #include <rtems/libio.h> |
---|
22 | #include <rtems/libio_.h> |
---|
23 | |
---|
24 | rtems_status_code rtems_libio_set_private_env(void) { |
---|
25 | rtems_status_code sc; |
---|
26 | |
---|
27 | sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free); |
---|
28 | if (sc != RTEMS_SUCCESSFUL) |
---|
29 | return sc; |
---|
30 | |
---|
31 | rtems_current_user_env = malloc(sizeof(rtems_user_env_t)); |
---|
32 | if (!rtems_current_user_env) |
---|
33 | return RTEMS_NO_MEMORY; |
---|
34 | |
---|
35 | *rtems_current_user_env = rtems_global_user_env; |
---|
36 | return RTEMS_SUCCESSFUL; |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.