-
Notifications
You must be signed in to change notification settings - Fork 8
/
common.h
28 lines (17 loc) · 917 Bytes
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
extern char** environ;
#define JB_ROOT_SYM ".jbroot"
#define ROOTFS_NAME "rootfs"
#define JB_ROOT_PREFIX ".jbroot-"
#define JB_ROOT_PARENT "/var/containers/Bundle/Application"
#define JB_RAND_LENGTH (sizeof(uint64_t)*sizeof(char)*2)
#define IGNORE_JBRAND_VERIFY 0
#define EXPORT __attribute__ ((visibility ("default")))
int is_jbroot_name(const char* name);
unsigned long long resolve_jbrand_value(const char* name);
extern const char* __roothideinit_JBRAND;
extern const char* __roothideinit_JBROOT;
#include <sys/syslog.h>
#define SYSLOG(...) {openlog("roothide",LOG_PID,LOG_AUTH);syslog(LOG_DEBUG, __VA_ARGS__);closelog();}
#define JBPATH_LOG(...) {if(getenv("JBPATHLOG")&&atoi(getenv("JBPATHLOG"))) {printf(__VA_ARGS__);fflush(stdout);}}
#define VROOT_LOG(...) {if(getenv("VROOTLOG")&&atoi(getenv("VROOTLOG"))) {printf(__VA_ARGS__);fflush(stdout);}}
const char* getbacktrace(); //free after use