diff options
author | Abseil Team <absl-team@google.com> | 2023-06-29 12:58:39 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-06-29 12:59:30 -0700 |
commit | 4eaff9e61e173079bcac644db18f5536cec12d8b (patch) | |
tree | 8edd0196ad53c1a7d1d2806b9919d09f32b04a14 /absl/base/internal/sysinfo.cc | |
parent | 9402bd32fbb24f762f7923ece6afe131a5b57f35 (diff) |
Support Qualcomm Hexagon DSP targets.
PiperOrigin-RevId: 544438364
Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3
Diffstat (limited to 'absl/base/internal/sysinfo.cc')
-rw-r--r-- | absl/base/internal/sysinfo.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc index 605a11eb..8bcc4faf 100644 --- a/absl/base/internal/sysinfo.cc +++ b/absl/base/internal/sysinfo.cc @@ -190,7 +190,13 @@ static double GetNominalCPUFrequency() { // and the memory location pointed to by value is set to the value read. static bool ReadLongFromFile(const char *file, long *value) { bool ret = false; - int fd = open(file, O_RDONLY | O_CLOEXEC); +#if defined(_POSIX_C_SOURCE) + const int file_mode = (O_RDONLY | O_CLOEXEC); +#else + const int file_mode = O_RDONLY; +#endif + + int fd = open(file, file_mode); if (fd != -1) { char line[1024]; char *err; |