diff options
author | Lauri Aarnio <Lauri.Aarnio@iki.fi> | 2008-10-08 17:58:41 +0300 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2008-10-18 15:18:14 +0300 |
commit | 0be0f95156ef67d505dbfe2aee7efbffdd0a4c76 (patch) | |
tree | 59584c9641a44efcf7061cdd060e0252a67bcc1d /include | |
parent | 5044503fe4a18abc3907b7634ac7f35d8bbb5c22 (diff) |
Logging routines now print process and thread ids for multithreaded programs - initialization code (in luaif.c) detects if pthread_self is available, and the logger (sb_log.c) uses that to log PID/TID for multithreaded programs - if pthread library isn't available, only PID is logged
Diffstat (limited to 'include')
-rw-r--r-- | include/sb2.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sb2.h b/include/sb2.h index 7dd2ee6..f0ad840 100644 --- a/include/sb2.h +++ b/include/sb2.h @@ -11,6 +11,13 @@ #include <time.h> #include <stdarg.h> +/* WARNING!! + * pthread functions MUST NOT be used directly in the preload library. + * see the warning in luaif/luaif.c, also see the examples in that + * file (how to detect if pthread library is available, etc) +*/ +#include <pthread.h> + #include <lua.h> #include <lualib.h> #include <lauxlib.h> @@ -76,4 +83,6 @@ extern char *sbox_session_dir; extern char *sbox_orig_ld_preload; extern char *sbox_orig_ld_library_path; +extern pthread_t (*pthread_self_fnptr)(void); + #endif |