OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [include/] [rtems/] [userenv.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  userenv.h,v 1.1 2002/01/08 12:04:22 joel Exp
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
21
extern "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
 
35
typedef 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
 
52
extern rtems_user_env_t * rtems_current_user_env;
53
extern 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
 
71
rtems_status_code rtems_libio_set_private_env(void);
72
rtems_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 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.