Skip to content

Commit

Permalink
Fix extconf.rb to look for fdatasync in unistd.h
Browse files Browse the repository at this point in the history
Fix: #470
  • Loading branch information
byroot committed Jan 30, 2024
1 parent bb42813 commit 34f1be9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Fix a potential compilation issue on some systems. See #470.

# 1.18.1

* Handle `EPERM` errors when opening files with `O_NOATIME`.
Expand Down
1 change: 1 addition & 0 deletions ext/bootsnap/bootsnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>

#ifndef O_NOATIME
Expand Down
2 changes: 1 addition & 1 deletion ext/bootsnap/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "mkmf"

if %w[ruby truffleruby].include?(RUBY_ENGINE)
have_func "fdatasync", "fcntl.h"
have_func "fdatasync", "unistd.h"

unless RUBY_PLATFORM.match?(/mswin|mingw|cygwin/)
append_cppflags ["_GNU_SOURCE"] # Needed of O_NOATIME
Expand Down

0 comments on commit 34f1be9

Please sign in to comment.