Skip to content

Commit

Permalink
Default to getmntinfo if getmntinfo64 isn't found on Mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed Dec 30, 2020
1 parent c2b939d commit 5c45ca0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/sys/unix/sys/filesystem/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ module Functions
end
rescue FFI::NotFoundError
if RbConfig::CONFIG['host_os'] =~ /darwin|osx|mach/i
attach_function(:getmntinfo, :getmntinfo64, [:pointer, :int], :int)
begin
attach_function(:getmntinfo, :getmntinfo64, [:pointer, :int], :int)
rescue FFI::NotFoundError
attach_function(:getmntinfo, [:pointer, :int], :int) # Big Sur and later
end
else
attach_function(:getmntinfo, [:pointer, :int], :int)
end
Expand Down

0 comments on commit 5c45ca0

Please sign in to comment.