Skip to content

Commit

Permalink
Consistently adjust FD_SETSIZE on all extensions
Browse files Browse the repository at this point in the history
Previously only `rubyeventmachine` FD were adjusted. Just to be consistent
all compiled extensions should be doing the same.
  • Loading branch information
luislavena committed Jun 28, 2012
1 parent 5cfcce3 commit 923c8ac
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ext/fastfilereader/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ def add_define(name)
add_define 'OS_UNIX'
end

# Adjust number of file descriptors (FD) on Windows

if RbConfig::CONFIG["host_os"] =~ /mingw/
found = RbConfig::CONFIG.values_at("CFLAGS", "CPPFLAGS").
any? { |v| v.include?("FD_SETSIZE") }

add_define "FD_SETSIZE=32767" unless found
end

# Main platform invariances:

case RUBY_PLATFORM
Expand Down Expand Up @@ -91,4 +100,4 @@ def add_define(name)
CONFIG['LDSHARED'] = "$(CXX) -shared"
end

create_makefile "fastfilereaderext"
create_makefile "fastfilereaderext"

0 comments on commit 923c8ac

Please sign in to comment.