work around bluetooth linger bug
[trinity.git] / include / shm.h
blob353f78a1ffdba4447dfa25fa238c5de1af56989d
1 #ifndef _SHM_H
2 #define _SHM_H 1
4 #include <sys/time.h>
5 #include <sys/types.h>
7 #include <stdio.h>
9 #include "constants.h"
10 #include "exit.h"
11 #include "net.h"
12 #include "types.h"
14 struct shm_s {
15 unsigned long total_syscalls_done;
16 unsigned long successes;
17 unsigned long failures;
18 unsigned long previous_count;
19 unsigned long child_syscall_count[MAX_NR_CHILDREN];
21 unsigned long regenerate;
22 unsigned int seed;
23 unsigned int seeds[MAX_NR_CHILDREN];
24 unsigned int reseed_counter;
26 //Indices of syscall in syscall table that are active. All indices shifted by +1. Empty index equals to 0.
27 int active_syscalls32[MAX_NR_SYSCALL];
28 int active_syscalls64[MAX_NR_SYSCALL];
29 int active_syscalls[MAX_NR_SYSCALL];
30 unsigned int nr_active_syscalls;
31 unsigned int nr_active_32bit_syscalls;
32 unsigned int nr_active_64bit_syscalls;
34 pid_t mainpid;
35 pid_t pids[MAX_NR_CHILDREN];
36 unsigned char child_type[MAX_NR_CHILDREN];
38 pid_t last_reaped;
39 bool spawn_no_more;
40 char kill_count[MAX_NR_CHILDREN];
42 unsigned int max_children;
43 unsigned int running_childs;
44 struct timeval tv[MAX_NR_CHILDREN];
46 FILE *logfiles[MAX_NR_CHILDREN];
48 int pipe_fds[MAX_PIPE_FDS*2];
49 int file_fds[NR_FILE_FDS]; /* All children inherit these */
50 int perf_fds[MAX_PERF_FDS];
51 int epoll_fds[MAX_EPOLL_FDS];
52 int eventfd_fds[MAX_EPOLL_FDS];
54 struct socketinfo sockets[NR_SOCKET_FDS];
56 /* state for the syscall currently in progress. */
57 unsigned int previous_syscallno[MAX_NR_CHILDREN];
58 unsigned long previous_a1[MAX_NR_CHILDREN];
59 unsigned long previous_a2[MAX_NR_CHILDREN];
60 unsigned long previous_a3[MAX_NR_CHILDREN];
61 unsigned long previous_a4[MAX_NR_CHILDREN];
62 unsigned long previous_a5[MAX_NR_CHILDREN];
63 unsigned long previous_a6[MAX_NR_CHILDREN];
65 unsigned int syscallno[MAX_NR_CHILDREN];
66 unsigned long a1[MAX_NR_CHILDREN];
67 unsigned long a2[MAX_NR_CHILDREN];
68 unsigned long a3[MAX_NR_CHILDREN];
69 unsigned long a4[MAX_NR_CHILDREN];
70 unsigned long a5[MAX_NR_CHILDREN];
71 unsigned long a6[MAX_NR_CHILDREN];
73 int current_fd;
74 unsigned int fd_lifetime;
76 /* various flags. */
77 bool do32bit[MAX_NR_CHILDREN];
78 bool do_make_it_fail;
79 bool need_reseed;
80 enum exit_reasons exit_reason;
82 /* locks */
83 volatile unsigned char regenerating;
84 volatile unsigned char reaper_lock;
86 bool ready;
88 extern struct shm_s *shm;
90 #define SHM_OK 0
91 #define SHM_CORRUPT 1
93 #endif /* _SHM_H */