3
#include <netinet/in.h>
12
#ifdef HAVE_CAPABILITIES
13
#include <sys/capability.h>
21
struct argvtab *argvs = NULL;
24
struct rlimit *rlimits = NULL;
27
struct logtab *logtabs = NULL;
30
char **strings = NULL;
33
struct buftab *bufs = NULL;
36
struct oplist *oplists = NULL;
39
struct pidtab pidtabs[8] = {
40
{ 0, NULL, NULL, NULL, 0, NULL },
41
{ 0, NULL, NULL, NULL, 0, NULL },
42
{ 0, NULL, NULL, NULL, 0, NULL },
43
{ 0, NULL, NULL, NULL, 0, NULL },
44
{ 0, NULL, NULL, NULL, 0, NULL },
45
{ 0, NULL, NULL, NULL, 0, NULL },
46
{ 0, NULL, NULL, NULL, 0, NULL },
47
{ 0, NULL, NULL, NULL, 0, NULL }
50
struct semaphore *sems = NULL;
53
#ifdef HAVE_CAPABILITIES
58
fd_set *fdsets = NULL;
62
memset(pidtabs, 0, 8 * sizeof(struct pidtab));
65
static struct pidtab *pidtab_new() {
68
p = (struct pidtab *)malloc(sizeof(struct pidtab));
70
rl_fatal(EX_SOFTWARE, _("ABORT - Can't allocate memory"));
71
memset(p, 0, sizeof(struct pidtab));
75
void pidtab_add(pid_t pid, int onexit, struct rl_instance *inst) {
76
struct pidtab *p = pidtab_new();
80
p->prev = pidtabs + (pid & 0x7);
81
p->next = p->prev->next;
88
#define CHECK(tab,print) \
89
fprintf(stderr, #tab " get %d, %d\n", i, num##tab); \
90
if (i < 0 || i >= num##tab) { fprintf(stderr, #tab ", %d >= %d\n", i, num##tab); return 0; } \
91
else if (print) fprintf(stderr, #tab "[%d] = %s\n", i, tab[i]); \
94
#define CHECK(tab,print)
97
struct pidtab *pidtab_get(pid_t pid) {
100
p = pidtabs[pid & 0x7].next;
107
} while((p = p->next));
111
struct logtab *logtab_get(int i) {
116
struct rlimit *rlimittab_get(int i) {
121
struct argvtab *argvtab_get(int i) {
126
#ifdef HAVE_CAPABILITIES
128
cap_t captab_get(int i) {
132
#endif /* HAVE_CAPABILITIES */
135
char *stringtab_get(int i) {
140
struct buftab *buftab_get(int i) {
145
rl_opcode_t *oplisttab_get(int i) {
147
return oplists[i].ops_list;
150
struct semaphore *semaphore_get(int i) {
155
fd_set *fdsettab_get(int i) {