Changeset 2a929cc in rtems


Ignore:
Timestamp:
Jan 25, 2001, 3:59:58 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
41caf2df
Parents:
4a80bf2b
Message:

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.
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/include/rtems/libio_.h

    r4a80bf2b r2a929cc  
    6464extern rtems_libio_t  *rtems_libio_last_iop;
    6565extern rtems_libio_t *rtems_libio_iop_freelist;
    66 
    67 /*
    68  *  Default mode for all files.
    69  */
    70 
    71 extern mode_t    rtems_filesystem_umask;
    7266
    7367/*
     
    215209 *  External structures
    216210 */
    217 
    218 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    219 extern rtems_filesystem_location_info_t rtems_filesystem_root;
    220 extern nlink_t                          rtems_filesystem_link_counts;
     211typedef struct {
     212 rtems_filesystem_location_info_t current_directory;
     213 rtems_filesystem_location_info_t root_directory;
     214 /* Default mode for all files. */
     215 mode_t                           umask;
     216 nlink_t                          link_counts;
     217} rtems_user_env_t;
     218
     219extern rtems_user_env_t * rtems_current_user_env;
     220extern rtems_user_env_t   rtems_global_user_env;
     221
     222#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
     223#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
     224#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
     225#define rtems_filesystem_umask       (rtems_current_user_env->umask)
     226
     227/*
     228 *  Instantiate a private copy of the per user information for the calling task.
     229 */
     230
     231rtems_status_code rtems_libio_set_private_env(void);
    221232
    222233
  • c/src/exec/libcsupport/include/rtems/libio_.h

    r4a80bf2b r2a929cc  
    6464extern rtems_libio_t  *rtems_libio_last_iop;
    6565extern rtems_libio_t *rtems_libio_iop_freelist;
    66 
    67 /*
    68  *  Default mode for all files.
    69  */
    70 
    71 extern mode_t    rtems_filesystem_umask;
    7266
    7367/*
     
    215209 *  External structures
    216210 */
    217 
    218 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    219 extern rtems_filesystem_location_info_t rtems_filesystem_root;
    220 extern nlink_t                          rtems_filesystem_link_counts;
     211typedef struct {
     212 rtems_filesystem_location_info_t current_directory;
     213 rtems_filesystem_location_info_t root_directory;
     214 /* Default mode for all files. */
     215 mode_t                           umask;
     216 nlink_t                          link_counts;
     217} rtems_user_env_t;
     218
     219extern rtems_user_env_t * rtems_current_user_env;
     220extern rtems_user_env_t   rtems_global_user_env;
     221
     222#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
     223#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
     224#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
     225#define rtems_filesystem_umask       (rtems_current_user_env->umask)
     226
     227/*
     228 *  Instantiate a private copy of the per user information for the calling task.
     229 */
     230
     231rtems_status_code rtems_libio_set_private_env(void);
    221232
    222233
  • c/src/exec/libcsupport/src/Makefile.am

    r4a80bf2b r2a929cc  
    1313
    1414BASE_FS_C_FILES = base_fs.c mount.c unmount.c libio.c \
    15     libio_sockets.c eval.c fs_null_handlers.c
     15    libio_sockets.c eval.c fs_null_handlers.c privateenv.c
    1616
    1717TERMIOS_C_FILES = cfgetispeed.c cfgetospeed.c cfsetispeed.c cfsetospeed.c \
  • c/src/exec/libcsupport/src/base_fs.c

    r4a80bf2b r2a929cc  
    2424 */
    2525
    26 rtems_filesystem_location_info_t rtems_filesystem_current;
    27 rtems_filesystem_location_info_t rtems_filesystem_root;
    28 nlink_t                          rtems_filesystem_link_counts;
     26rtems_user_env_t   rtems_global_user_env;
     27rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
    2928
    3029/*
     
    3231 */
    3332
    34 mode_t rtems_filesystem_umask;
    3533
    3634/*
  • c/src/exec/libcsupport/src/unmount.c

    r4a80bf2b r2a929cc  
    3838
    3939extern Chain_Control                    rtems_filesystem_mount_table_control;
    40 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    4140
    4241int search_mt_for_mount_point(
  • c/src/lib/include/rtems/libio_.h

    r4a80bf2b r2a929cc  
    6464extern rtems_libio_t  *rtems_libio_last_iop;
    6565extern rtems_libio_t *rtems_libio_iop_freelist;
    66 
    67 /*
    68  *  Default mode for all files.
    69  */
    70 
    71 extern mode_t    rtems_filesystem_umask;
    7266
    7367/*
     
    215209 *  External structures
    216210 */
    217 
    218 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    219 extern rtems_filesystem_location_info_t rtems_filesystem_root;
    220 extern nlink_t                          rtems_filesystem_link_counts;
     211typedef struct {
     212 rtems_filesystem_location_info_t current_directory;
     213 rtems_filesystem_location_info_t root_directory;
     214 /* Default mode for all files. */
     215 mode_t                           umask;
     216 nlink_t                          link_counts;
     217} rtems_user_env_t;
     218
     219extern rtems_user_env_t * rtems_current_user_env;
     220extern rtems_user_env_t   rtems_global_user_env;
     221
     222#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
     223#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
     224#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
     225#define rtems_filesystem_umask       (rtems_current_user_env->umask)
     226
     227/*
     228 *  Instantiate a private copy of the per user information for the calling task.
     229 */
     230
     231rtems_status_code rtems_libio_set_private_env(void);
    221232
    222233
  • c/src/lib/libc/Makefile.am

    r4a80bf2b r2a929cc  
    1313
    1414BASE_FS_C_FILES = base_fs.c mount.c unmount.c libio.c \
    15     libio_sockets.c eval.c fs_null_handlers.c
     15    libio_sockets.c eval.c fs_null_handlers.c privateenv.c
    1616
    1717TERMIOS_C_FILES = cfgetispeed.c cfgetospeed.c cfsetispeed.c cfsetospeed.c \
  • c/src/lib/libc/base_fs.c

    r4a80bf2b r2a929cc  
    2424 */
    2525
    26 rtems_filesystem_location_info_t rtems_filesystem_current;
    27 rtems_filesystem_location_info_t rtems_filesystem_root;
    28 nlink_t                          rtems_filesystem_link_counts;
     26rtems_user_env_t   rtems_global_user_env;
     27rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
    2928
    3029/*
     
    3231 */
    3332
    34 mode_t rtems_filesystem_umask;
    3533
    3634/*
  • c/src/lib/libc/unmount.c

    r4a80bf2b r2a929cc  
    3838
    3939extern Chain_Control                    rtems_filesystem_mount_table_control;
    40 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    4140
    4241int search_mt_for_mount_point(
  • cpukit/include/rtems/libio_.h

    r4a80bf2b r2a929cc  
    6464extern rtems_libio_t  *rtems_libio_last_iop;
    6565extern rtems_libio_t *rtems_libio_iop_freelist;
    66 
    67 /*
    68  *  Default mode for all files.
    69  */
    70 
    71 extern mode_t    rtems_filesystem_umask;
    7266
    7367/*
     
    215209 *  External structures
    216210 */
    217 
    218 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    219 extern rtems_filesystem_location_info_t rtems_filesystem_root;
    220 extern nlink_t                          rtems_filesystem_link_counts;
     211typedef struct {
     212 rtems_filesystem_location_info_t current_directory;
     213 rtems_filesystem_location_info_t root_directory;
     214 /* Default mode for all files. */
     215 mode_t                           umask;
     216 nlink_t                          link_counts;
     217} rtems_user_env_t;
     218
     219extern rtems_user_env_t * rtems_current_user_env;
     220extern rtems_user_env_t   rtems_global_user_env;
     221
     222#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
     223#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
     224#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
     225#define rtems_filesystem_umask       (rtems_current_user_env->umask)
     226
     227/*
     228 *  Instantiate a private copy of the per user information for the calling task.
     229 */
     230
     231rtems_status_code rtems_libio_set_private_env(void);
    221232
    222233
  • cpukit/libcsupport/include/rtems/libio_.h

    r4a80bf2b r2a929cc  
    6464extern rtems_libio_t  *rtems_libio_last_iop;
    6565extern rtems_libio_t *rtems_libio_iop_freelist;
    66 
    67 /*
    68  *  Default mode for all files.
    69  */
    70 
    71 extern mode_t    rtems_filesystem_umask;
    7266
    7367/*
     
    215209 *  External structures
    216210 */
    217 
    218 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    219 extern rtems_filesystem_location_info_t rtems_filesystem_root;
    220 extern nlink_t                          rtems_filesystem_link_counts;
     211typedef struct {
     212 rtems_filesystem_location_info_t current_directory;
     213 rtems_filesystem_location_info_t root_directory;
     214 /* Default mode for all files. */
     215 mode_t                           umask;
     216 nlink_t                          link_counts;
     217} rtems_user_env_t;
     218
     219extern rtems_user_env_t * rtems_current_user_env;
     220extern rtems_user_env_t   rtems_global_user_env;
     221
     222#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
     223#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
     224#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
     225#define rtems_filesystem_umask       (rtems_current_user_env->umask)
     226
     227/*
     228 *  Instantiate a private copy of the per user information for the calling task.
     229 */
     230
     231rtems_status_code rtems_libio_set_private_env(void);
    221232
    222233
  • cpukit/libcsupport/src/base_fs.c

    r4a80bf2b r2a929cc  
    2424 */
    2525
    26 rtems_filesystem_location_info_t rtems_filesystem_current;
    27 rtems_filesystem_location_info_t rtems_filesystem_root;
    28 nlink_t                          rtems_filesystem_link_counts;
     26rtems_user_env_t   rtems_global_user_env;
     27rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
    2928
    3029/*
     
    3231 */
    3332
    34 mode_t rtems_filesystem_umask;
    3533
    3634/*
  • cpukit/libcsupport/src/unmount.c

    r4a80bf2b r2a929cc  
    3838
    3939extern Chain_Control                    rtems_filesystem_mount_table_control;
    40 extern rtems_filesystem_location_info_t rtems_filesystem_current;
    4140
    4241int search_mt_for_mount_point(
Note: See TracChangeset for help on using the changeset viewer.