Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1295)

Unified Diff: sandbox/linux/system_headers/linux_signal.h

Issue 1029283003: WIP: Implement seccomp-bpf sandbox for nacl_helper_nonsfi. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/system_headers/linux_seccomp.h ('k') | sandbox/sandbox_nacl_nonsfi.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/system_headers/linux_signal.h
diff --git a/sandbox/linux/system_headers/linux_signal.h b/sandbox/linux/system_headers/linux_signal.h
new file mode 100644
index 0000000000000000000000000000000000000000..b79980978a2146a3dbd80d89ff618c15a5795c3b
--- /dev/null
+++ b/sandbox/linux/system_headers/linux_signal.h
@@ -0,0 +1,55 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_
+#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_
+
+// NOTE: On some toolchains, signal related ABI is incompatible with Linux's.
+// So, here we declare necessary macros, structs and functions in Linux ABI.
+
+#include <stdint.h>
+
+#define LINUX_SIGBUS 7
+#define LINUX_SIGSYS 31
+
+#define LINUX_SIG_BLOCK 0
+#define LINUX_SIG_UNBLOCK 1
+
+#define LINUX_SA_SIGINFO 4
+#define LINUX_SA_NODEFER 0x40000000
+
+#define LINUX_SIG_DFL 0
+
+struct arch_sigsys {
+ void* ip;
+ int nr;
+ unsigned int arch;
+};
+
+typedef struct {
+ int si_signo;
+ int si_errno;
+ int si_code;
+ struct {
+ struct arch_sigsys _sigsys;
+ } _sifields;
+} linux_siginfo_t;
+
+// Linux sigset_t is 64 bits.
+typedef struct {
+ uint32_t sig[2];
+} linux_sigset_t;
+
+struct linux_sigaction {
+ // Traling '_' is to avoid name confliction defined by some toolchains.
+ union {
+ void (*sa_handler_)(int);
+ void (*sa_sigaction_)(int, linux_siginfo_t*, void*);
+ };
+ uint32_t sa_flags;
+ void (*sa_restorer)(void);
+ linux_sigset_t sa_mask;
+};
+
+#endif
« no previous file with comments | « sandbox/linux/system_headers/linux_seccomp.h ('k') | sandbox/sandbox_nacl_nonsfi.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698