Index: base/rand_util_posix.cc |
diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc |
index 469f7af9bf36ae2df93cdea214edbb661c27e574..aaad67f177f397cffda845795fbaa625cd9fc4f7 100644 |
--- a/base/rand_util_posix.cc |
+++ b/base/rand_util_posix.cc |
@@ -23,9 +23,17 @@ namespace { |
// we can use LazyInstance to handle opening it on the first access. |
class URandomFd { |
public: |
+#if defined(OS_AIX) |
+ // AIX has no 64-bit support for open falgs such as - |
+ // O_CLOEXEC, O_NOFOLLOW and O_TTY_INIT |
+ URandomFd() : fd_(HANDLE_EINTR(open("/dev/urandom", O_RDONLY))) { |
+ DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno; |
+ } |
+#else |
URandomFd() : fd_(HANDLE_EINTR(open("/dev/urandom", O_RDONLY | O_CLOEXEC))) { |
DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno; |
} |
+#endif |
~URandomFd() { close(fd_); } |