posixc.library: add a simple user/grp emulation for purpose of set/get uid functions
[AROS.git] / compiler / posixc / __posixc_intbase.h
blob8e648a0c2e83358cfd1a8bd24206ab3d534d99f2
1 /*
2 Copyright © 2012-2016, The AROS Development Team. All rights reserved.
3 $Id$
5 This file defines the private part of PosixCBase.
6 This should only be used internally in posixc.library code so
7 changes can be made to this structure without breaking backwards
8 compatibility.
9 */
10 #ifndef __POSIXC_INTBASE_H
11 #define __POSIXC_INTBASE_H
13 #include <libraries/posixc.h>
14 #include <exec/lists.h>
15 #include <dos/dos.h>
17 #include <stdint.h>
18 #include <stdio.h>
19 #include <sys/stat.h>
21 /* Some private structs */
22 struct random_state;
23 struct __env_item;
24 struct _fdesc;
25 struct vfork_data;
27 struct PosixCIntBase
29 struct PosixCBase PosixCBase;
31 /* common */
32 APTR internalpool;
33 int32_t flags;
35 /* random.c */
36 struct random_state *rs;
38 /* __posixc_environ.c; don't use this field outside that file */
39 char ***environptr;
41 /* __env.c */
42 struct __env_item *env_list;
44 /* __exec.c */
45 BPTR exec_seglist;
46 char *exec_args;
47 char *exec_taskname;
48 APTR exec_pool;
49 char **exec_tmparray;
50 BPTR exec_oldin, exec_oldout, exec_olderr;
51 struct StdCBase *exec_oldstdcbase;
53 /* __fdesc.c */
54 int fd_slots;
55 struct _fdesc **fd_array;
57 /* __upath.c */
58 char *upathbuf; /* Buffer that holds intermediate converted paths */
59 int doupath; /* BOOL - does the conversion need to be done? */
60 int parent_does_upath; /* BOOL - parent does upath conversion */
62 /* __vfork.c */
63 struct vfork_data *vfork_data;
65 /* chdir.c/fchdir.c */
66 int cd_changed;
67 BPTR cd_lock;
69 /* flock.c */
70 struct MinList _file_locks, *file_locks;
72 /* umask */
73 mode_t umask;
75 /* __stdio.c */
76 struct MinList stdio_files;
78 /* setuid.c/getuid.c */
79 uid_t uid; /* Real user id of process */
80 uid_t euid; /* Effective user id of process */
83 /* flags; values of flags are power of two so they can be ORed together */
85 /* When a program is started with the exec functions and from vfork,
86 this is indicated in the flags of the library.
87 This way the child can use the parent posixc.library during its
88 initialization phase */
89 #define EXEC_PARENT 0x00000001
90 #define VFORK_PARENT 0x00000002
92 /* This flag is set by vfork() to correctly report child process ID during
93 execution of child code, even though that it's actually executed by parent
94 process until execve() is called. */
95 #define PRETEND_CHILD 0x00000004
97 #endif //__POSIXC_INTBASE_H