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

Unified Diff: base/process/launch_posix.cc

Issue 1161933003: Demo: Build NamespaceSandbox::ForkInNewPidNamespace. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « base/process/launch.h ('k') | sandbox/linux/services/namespace_sandbox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index 77edc1283191c9a6ad77b9a323cbd9cdf7d00153..f7f75a441b338fec4ec98256306beec5c7bd19dc 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -67,6 +67,7 @@ namespace base {
namespace {
+#if !defined(OS_NACL_NONSFI)
// Get the process's "environment" (i.e. the thing that setenv/getenv
// work with).
char** GetEnvironment() {
@@ -189,7 +190,9 @@ void ResetChildSignalHandlersToDefaults(void) {
#endif // !defined(OS_LINUX) ||
// (!defined(__i386__) && !defined(__x86_64__) && !defined(__arm__))
-#if defined(OS_LINUX)
+#endif // !defined(OS_NACL_NONSFI)
+
+#if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
bool IsRunningOnValgrind() {
return RUNNING_ON_VALGRIND;
}
@@ -235,10 +238,11 @@ NOINLINE pid_t CloneAndLongjmpInChild(unsigned long flags,
#endif
return clone(&CloneHelper, stack, flags, env, ptid, nullptr, ctid);
}
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI)
} // anonymous namespace
+#if !defined(OS_NACL_NONSFI)
// Functor for |ScopedDIR| (below).
struct ScopedDIRClose {
inline void operator()(DIR* x) const {
@@ -741,7 +745,9 @@ bool GetAppOutputWithExitCode(const CommandLine& cl,
return result == EXECUTE_SUCCESS;
}
-#if defined(OS_LINUX)
+#endif // !defined(OS_NACL_NONSFI)
+
+#if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid) {
const bool clone_tls_used = flags & CLONE_SETTLS;
const bool invalid_ctid =
@@ -780,6 +786,6 @@ pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid) {
return 0;
}
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI)
} // namespace base
« no previous file with comments | « base/process/launch.h ('k') | sandbox/linux/services/namespace_sandbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698