aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2012-08-22 14:29:11 -0700
committerDerek Schuff <dschuff@chromium.org>2012-08-22 14:29:11 -0700
commit8a9f83838bcd7aded2e6e77e45e6d345f574bed4 (patch)
treef7c9c36936f511cafca8babe808192f034334722 /lib/Support/Unix
parent3aca8f9d6ed91072668bc4fd92829bf47edc75d7 (diff)
Idef out mapped_file_region for nacl
Newlib does not have ftruncate, and we can't map files in nacl anyway. Fixes translator build R=jvoung@chromium.org,sehr@chromium.org,robertm@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/10874018
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r--lib/Support/Unix/PathV2.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc
index 4c9bbacb15..59c5ae5808 100644
--- a/lib/Support/Unix/PathV2.inc
+++ b/lib/Support/Unix/PathV2.inc
@@ -496,6 +496,10 @@ rety_open_create:
}
error_code mapped_file_region::init(int fd, uint64_t offset) {
+#ifdef __native_client__
+ // Newlib does not have ftruncate.
+ llvm_unreachable("mapped_file_region not implemented for native client");
+#else
AutoFD FD(fd);
// Figure out how large the file is.
@@ -521,6 +525,7 @@ error_code mapped_file_region::init(int fd, uint64_t offset) {
if (Mapping == MAP_FAILED)
return error_code(errno, system_category());
return error_code::success();
+#endif // __native_client__
}
mapped_file_region::mapped_file_region(const Twine &path,
@@ -531,6 +536,9 @@ mapped_file_region::mapped_file_region(const Twine &path,
: Mode(mode)
, Size(length)
, Mapping() {
+#ifdef __native_client__
+ llvm_unreachable("mapped_file_region not implemented for native client");
+#endif
// Make sure that the requested size fits within SIZE_T.
if (length > std::numeric_limits<size_t>::max()) {
ec = make_error_code(errc::invalid_argument);
@@ -559,6 +567,9 @@ mapped_file_region::mapped_file_region(int fd,
: Mode(mode)
, Size(length)
, Mapping() {
+#ifdef __native_client__
+ llvm_unreachable("mapped_file_region not implemented for native client");
+#endif
// Make sure that the requested size fits within SIZE_T.
if (length > std::numeric_limits<size_t>::max()) {
ec = make_error_code(errc::invalid_argument);