work around bluetooth linger bug
[trinity.git] / include / trinity.h
blob961a77b5e67c3395b24501128775afa55acb530f
1 #ifndef _TRINITY_H
2 #define _TRINITY_H 1
4 #include "types.h"
6 extern unsigned int num_online_cpus;
8 #define UNLOCKED 0
9 #define LOCKED 1
11 #define __unused__ __attribute((unused))
13 extern char *progname;
15 void * alloc_shared(unsigned int size);
17 void do_main_loop(void);
19 extern bool biarch;
21 int check_tainted(void);
23 void init_watchdog(void);
24 unsigned int check_if_fd(unsigned int child);
26 extern unsigned int user_specified_children;
28 void regenerate(void);
30 #define UNUSED(x) (void)(x)
32 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
34 #define max(x, y) ((x) >= (y) ? (x) : (y))
35 #define min(x, y) ((x) <= (y) ? (x) : (y))
37 #ifndef offsetof
38 # define offsetof(type, member) ((size_t) &((type *) 0)->member)
39 #endif
41 #define MAX_ERRNO 4095
42 #define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)
43 static inline long IS_ERR(unsigned long x)
45 return IS_ERR_VALUE(x);
49 #endif /* _TRINITY_H */