source: rtems/c/src/exec/include/rtems/userenv.h @ 6ba9c27

4.104.114.84.95
Last change on this file since 6ba9c27 was dd2906e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/08/02 at 12:04:22

2002-01-07 Ralf Corsepius <corsepiu@…>

  • wrapup/Makefile.am: Add install-hook. Remove SIZE_RTEMS.
  • include/rtems/fs.h: New, extracted from libio_.h.
  • include/rtems/userenv.h: New. extracted from libio_.h.
  • Property mode set to 100644
File size: 2.2 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.OARcorp.com/rtems/license.html.
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#if !defined(LOGIN_NAME_MAX)
28#if defined(__linux__)
29#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
30#else
31#error "don't know how to set LOGIN_NAME_MAX"
32#endif
33#endif
34
35typedef struct {
36 rtems_id                         task_id;     
37 rtems_filesystem_location_info_t current_directory;
38 rtems_filesystem_location_info_t root_directory;
39 /* Default mode for all files. */
40 mode_t                           umask;
41 nlink_t                          link_counts;
42 /* _POSIX_types */
43 uid_t                            uid;
44 gid_t                            gid;
45 uid_t                            euid;
46 gid_t                            egid;
47 char      login_buffer[LOGIN_NAME_MAX];
48
49 pid_t                            pgrp; /* process group id */
50} rtems_user_env_t;
51
52extern rtems_user_env_t * rtems_current_user_env;
53extern rtems_user_env_t   rtems_global_user_env;
54
55#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
56#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
57#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
58#define rtems_filesystem_umask       (rtems_current_user_env->umask)
59
60#define _POSIX_types_Uid             (rtems_current_user_env->uid)
61#define _POSIX_types_Gid             (rtems_current_user_env->gid)
62#define _POSIX_types_Euid            (rtems_current_user_env->euid)
63#define _POSIX_types_Egid            (rtems_current_user_env->egid)
64#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
65
66
67/*
68 *  Instantiate a private copy of the per user information for the calling task.
69 */
70
71rtems_status_code rtems_libio_set_private_env(void);
72rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
73       
74#ifdef __cplusplus
75}
76#endif
77
78#endif
79/* end of include file */
Note: See TracBrowser for help on using the repository browser.