Skip to content

Commit

Permalink
[rust] Declare madvise() on illumos
Browse files Browse the repository at this point in the history
Illumos seems to have made a real mess here. Adopt the same
workaround as https://reviews.llvm.org/D84046 and
https://reviews.llvm.org/D86166.
  • Loading branch information
nikic committed Feb 13, 2022
1 parent 514d055 commit 54c5869
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/lib/Support/Unix/Path.inc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ typedef uint_t uint;
#define STATVFS_F_FLAG(vfs) (vfs).f_flags
#endif

#if defined(__sun__)
// The madvise() declaration on Illumos cannot be made visible if _XOPEN_SOURCE
// is defined. This declaration is also compatible with Solaris 11.4.
extern "C" int madvise(void *, size_t, int);
#endif

using namespace llvm;

namespace llvm {
Expand Down

0 comments on commit 54c5869

Please sign in to comment.