Non-SFI Mode: Build base/ library by PNaCL toolchain for nacl_helper_nonsfi.

This CL is to build base/ for nacl_helper_nonsfi.
The library is similar to base_nacl, but slightly different:
- For rand_util, rand_util_posix should be used, instead of
  rand_util_nacl, because nacl_helper_nonsfi will be running under
  Linux directly.
- MessageLoopForIO should be based on MessagePumpLibevent rather than
  MessagePumpDefault, to support IPC.
- GetKnownDeadTerminationStatus, GetTerminationStatus,
  UnixDomainSocket::SendMsg and RecvMsg are included, as these are used
  to implement nacl_helper_nonsfi binary.
- GLIB is not supported. It is unnecessary for nacl_helper_nonsfi.
Note that this library is not used yet from any binary, because this CL
is just a preparation, but the library is built actually.

BUG=358465
TEST=Ran trybot. Implement nacl_helper_nonsfi on top of this CL, and made sure
it is working.

Review URL: https://codereview.chromium.org/659513004

Cr-Commit-Position: refs/heads/master@{#300075}


CrOS-Libchrome-Original-Commit: 2b720d21260715614abea6f241874cc779f01332
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index 561f5c7..5a94cef 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -59,6 +59,7 @@
 
 namespace base {
 
+#if !defined(__native_client_nonsfi__)
 namespace {
 
 #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL)
@@ -345,6 +346,7 @@
 
   return success;
 }
+#endif  // !defined(__native_client_nonsfi__)
 
 bool PathExists(const FilePath& path) {
   ThreadRestrictions::AssertIOAllowed();
@@ -356,6 +358,7 @@
   return access(path.value().c_str(), F_OK) == 0;
 }
 
+#if !defined(__native_client_nonsfi__)
 bool PathIsWritable(const FilePath& path) {
   ThreadRestrictions::AssertIOAllowed();
   return access(path.value().c_str(), W_OK) == 0;
@@ -368,6 +371,7 @@
     return S_ISDIR(file_info.st_mode);
   return false;
 }
+#endif  // !defined(__native_client_nonsfi__)
 
 bool ReadFromFD(int fd, char* buffer, size_t bytes) {
   size_t total_read = 0;
@@ -381,6 +385,7 @@
   return total_read == bytes;
 }
 
+#if !defined(__native_client_nonsfi__)
 bool CreateSymbolicLink(const FilePath& target_path,
                         const FilePath& symlink_path) {
   DCHECK(!symlink_path.empty());
@@ -920,4 +925,6 @@
 #endif  // !defined(OS_MACOSX)
 
 }  // namespace internal
+
+#endif  // !defined(__native_client_nonsfi__)
 }  // namespace base