diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 02:05:08 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 02:39:36 -0500 |
commit | 4ff12b76f2ebf13ac079e733635fcea832631966 (patch) | |
tree | 243499fbccdcf239ce126fedd8f64ec6565f10cd /headers.h | |
parent | libsandbox: shuffle/unify local prototypes (diff) | |
download | sandbox-4ff12b76f2ebf13ac079e733635fcea832631966.tar.gz sandbox-4ff12b76f2ebf13ac079e733635fcea832631966.tar.bz2 sandbox-4ff12b76f2ebf13ac079e733635fcea832631966.zip |
libsandbox: lock main syscall code with a mutex
Since the main sandbox code maintains state with global variables (like
sbcontext), make sure we use a pthread mutex to prevent multiple threads
from corrupting each other. In the non-threaded case this shouldn't be
a problem as the C library provides redirection stubs in its own code.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'headers.h')
-rw-r--r-- | headers.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -36,6 +36,9 @@ #ifdef HAVE_MEMORY_H # include <memory.h> #endif +#ifdef HAVE_PTHREAD_H +# include <pthread.h> +#endif #ifdef HAVE_SIGINFO_H # include <siginfo.h> #endif |