source: rtems/cpukit/include/rtems/userenv.h @ adae165b

4.115
Last change on this file since adae165b was adae165b, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 29, 2011 at 9:30:32 PM

2011-08-29 Joel Sherrill <joel.sherrilL@…>

  • include/rtems/userenv.h, score/src/threadhandler.c: Formatting.
  • sapi/src/exshutdown.c: Add comments.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/**
2 * @file rtems/userenv.h
3 *
4 * This file defines the interface for POSIX per-process environment.
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-2011.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#ifndef _RTEMS_USERENV_H
19#define _RTEMS_USERENV_H
20
21#include <rtems.h>
22#include <rtems/fs.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/*
29 *  External structures
30 */
31
32/*
33 * According to IEEE Std 1003.1-2001,
34 * limits.h is supposed to provide _POSIX_LOGIN_NAME_MAX
35 * FIXME: We should not rely on this.
36 */
37#include <limits.h>
38
39#ifndef LOGIN_NAME_MAX
40#ifdef _POSIX_LOGIN_NAME_MAX
41#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
42#else
43/* Fallback */
44#define LOGIN_NAME_MAX 9
45#endif
46#endif
47
48typedef struct {
49  rtems_id                         task_id;
50  rtems_filesystem_location_info_t current_directory;
51  rtems_filesystem_location_info_t root_directory;
52  /* Default mode for all files. */
53  mode_t                           umask;
54  nlink_t                          link_counts;
55  /* _POSIX_types */
56  uid_t                            uid;
57  gid_t                            gid;
58  uid_t                            euid;
59  gid_t                            egid;
60  char      login_buffer[LOGIN_NAME_MAX];
61  pid_t                            pgrp; /* process group id */
62} rtems_user_env_t;
63
64extern rtems_user_env_t * rtems_current_user_env;
65extern rtems_user_env_t   rtems_global_user_env;
66
67#define rtems_filesystem_current     (rtems_current_user_env->current_directory)
68#define rtems_filesystem_root        (rtems_current_user_env->root_directory)
69#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
70#define rtems_filesystem_umask       (rtems_current_user_env->umask)
71
72#define _POSIX_types_Uid             (rtems_current_user_env->uid)
73#define _POSIX_types_Gid             (rtems_current_user_env->gid)
74#define _POSIX_types_Euid            (rtems_current_user_env->euid)
75#define _POSIX_types_Egid            (rtems_current_user_env->egid)
76#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
77
78
79/*
80 *  Instantiate a private copy of the per user information for the calling task.
81 */
82
83rtems_status_code rtems_libio_set_private_env(void);
84rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif
91/* end of include file */
Note: See TracBrowser for help on using the repository browser.