source: rtems/cpukit/include/rtems/userenv.h @ 36e92589

4.104.114.84.95
Last change on this file since 36e92589 was 36e92589, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 28, 2005 at 2:07:41 AM

2005-01-28 Ralf Corsepius <ralf.corsepius@…>

  • include/rtems/userenv.h: Set up LOGIN_NAME_MAX iff not having been defined before.
  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *  Libio Internal Information
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 *  $Id$
12 */
13
14#ifndef __rtems_userenv_h
15#define __rtems_userenv_h
16
17#include <rtems.h>
18#include <rtems/fs.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*
25 *  External structures
26 */
27
28/*
29 * According to IEEE Std 1003.1-2001,
30 * limits.h is supposed to provide _POSIX_LOGIN_NAME_MAX
31 * FIXME: We should not rely on this.
32 */
33#include <limits.h>
34
35#ifndef LOGIN_NAME_MAX
36#ifdef _POSIX_LOGIN_NAME_MAX
37#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
38#else
39/* Fallback */
40#define LOGIN_NAME_MAX 9
41#endif
42#endif
43
44typedef struct {
45 rtems_id                         task_id;     
46 rtems_filesystem_location_info_t current_directory;
47 rtems_filesystem_location_info_t root_directory;
48 /* Default mode for all files. */
49 mode_t                           umask;
50 nlink_t                          link_counts;
51 /* _POSIX_types */
52 uid_t                            uid;
53 gid_t                            gid;
54 uid_t                            euid;
55 gid_t                            egid;
56 char      login_buffer[LOGIN_NAME_MAX];
57
58 pid_t                            pgrp; /* process group id */
59} rtems_user_env_t;
60
61extern rtems_user_env_t * rtems_current_user_env; 
62extern rtems_user_env_t   rtems_global_user_env; 
63
64#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
65#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
66#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
67#define rtems_filesystem_umask       (rtems_current_user_env->umask)
68
69#define _POSIX_types_Uid             (rtems_current_user_env->uid)
70#define _POSIX_types_Gid             (rtems_current_user_env->gid)
71#define _POSIX_types_Euid            (rtems_current_user_env->euid)
72#define _POSIX_types_Egid            (rtems_current_user_env->egid)
73#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
74
75
76/*
77 *  Instantiate a private copy of the per user information for the calling task.
78 */
79
80rtems_status_code rtems_libio_set_private_env(void);
81rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
82       
83#ifdef __cplusplus
84}
85#endif
86
87#endif
88/* end of include file */
Note: See TracBrowser for help on using the repository browser.