Skip to content

Commit 4503555

Browse files
authored
POSIX compliant poll.h and mmap over sys/poll.h and mmap64 (dmlc#10767)
1 parent e1a2c1b commit 4503555

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/xgboost/collective/poll_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#if !defined(_WIN32)
3737

38-
#include <sys/poll.h>
38+
#include <poll.h>
3939

4040
using SOCKET = int;
4141
using sock_size_t = size_t; // NOLINT

src/common/io.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#if defined(__unix__) || defined(__APPLE__)
55

66
#include <fcntl.h> // for open, O_RDONLY
7-
#include <sys/mman.h> // for mmap, mmap64, munmap, madvise
7+
#include <sys/mman.h> // for mmap, munmap, madvise
88
#include <unistd.h> // for close, getpagesize
99

1010
#else
@@ -202,7 +202,7 @@ MMAPFile* detail::OpenMmap(std::string path, std::size_t offset, std::size_t len
202202

203203
#if defined(__linux__) || defined(__GLIBC__)
204204
int prot{PROT_READ};
205-
ptr = reinterpret_cast<std::byte*>(mmap64(nullptr, view_size, prot, MAP_PRIVATE, fd, view_start));
205+
ptr = reinterpret_cast<std::byte*>(mmap(nullptr, view_size, prot, MAP_PRIVATE, fd, view_start));
206206
CHECK_NE(ptr, MAP_FAILED) << "Failed to map: " << path << ". " << SystemErrorMsg();
207207
auto handle = new MMAPFile{fd, ptr, view_size, offset - view_start, std::move(path)};
208208
#elif defined(xgboost_IS_WIN)

0 commit comments

Comments
 (0)