Skip to content

Commit 34f1be9

Browse files
committed
Fix extconf.rb to look for fdatasync in unistd.h
Fix: #470
1 parent bb42813 commit 34f1be9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
* Fix a potential compilation issue on some systems. See #470.
4+
35
# 1.18.1
46

57
* Handle `EPERM` errors when opening files with `O_NOATIME`.

ext/bootsnap/bootsnap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <sys/types.h>
1919
#include <errno.h>
2020
#include <fcntl.h>
21+
#include <unistd.h>
2122
#include <sys/stat.h>
2223

2324
#ifndef O_NOATIME

ext/bootsnap/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "mkmf"
44

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

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

0 commit comments

Comments
 (0)