aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-18 02:05:08 -0500
committerMike Frysinger <vapier@gentoo.org>2009-02-18 02:39:36 -0500
commit4ff12b76f2ebf13ac079e733635fcea832631966 (patch)
tree243499fbccdcf239ce126fedd8f64ec6565f10cd /headers.h
parentlibsandbox: shuffle/unify local prototypes (diff)
downloadsandbox-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/headers.h b/headers.h
index b690056..74fd7b7 100644
--- a/headers.h
+++ b/headers.h
@@ -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