aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Bendersky <eliben@chromium.org>2013-07-18 17:39:24 -0700
committerEli Bendersky <eliben@chromium.org>2013-07-18 17:39:24 -0700
commit4a9f2a703db400ccf760f34101bcdd57642f96e4 (patch)
treef524d70ee6f2cf990c30f157e2f6f7c7a71816ed /lib
parent2f90dcad71d5a9ebc3ea2b7287eeb7731f9044b7 (diff)
Some more OS-specific calls were added that are not supported in the
sandboxed build. Condition them properly on __native_client__.
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Unix/PathV2.inc4
-rw-r--r--lib/Support/Unix/Program.inc4
-rw-r--r--lib/Support/Unix/Watchdog.inc4
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc
index f426fbf7fc..e3187516f6 100644
--- a/lib/Support/Unix/PathV2.inc
+++ b/lib/Support/Unix/PathV2.inc
@@ -417,6 +417,9 @@ error_code permissions(const Twine &path, perms prms) {
error_code unique_file(const Twine &model, int &result_fd,
SmallVectorImpl<char> &result_path,
bool makeAbsolute, unsigned mode) {
+#ifdef __native_client__
+ llvm_unreachable("unique_file() not implemented for Native Client");
+#else
SmallString<128> Model;
model.toVector(Model);
// Null terminate.
@@ -498,6 +501,7 @@ rety_open_create:
result_fd = RandomFD;
return error_code::success();
+#endif // __native_client__
}
error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc
index c6cc698e9b..576629794b 100644
--- a/lib/Support/Unix/Program.inc
+++ b/lib/Support/Unix/Program.inc
@@ -435,7 +435,11 @@ error_code Program::ChangeStderrToBinary(){
}
bool llvm::sys::argumentsFitWithinSystemLimits(ArrayRef<const char*> Args) {
+#if defined(__native_client__)
+ static long ArgMax = -1;
+#else // !__native_client__
static long ArgMax = sysconf(_SC_ARG_MAX);
+#endif // __native_client__
// System says no practical limit.
if (ArgMax == -1)
diff --git a/lib/Support/Unix/Watchdog.inc b/lib/Support/Unix/Watchdog.inc
index 5d89c0e51b..9133d01183 100644
--- a/lib/Support/Unix/Watchdog.inc
+++ b/lib/Support/Unix/Watchdog.inc
@@ -19,13 +19,17 @@ namespace llvm {
namespace sys {
Watchdog::Watchdog(unsigned int seconds) {
#ifdef HAVE_UNISTD_H
+ #ifndef __native_client__
alarm(seconds);
+ #endif // __native_client__
#endif
}
Watchdog::~Watchdog() {
#ifdef HAVE_UNISTD_H
+ #ifndef __native_client__
alarm(0);
+ #endif //__native_client__
#endif
}
}