about summary refs log tree commit homepage
path: root/ext/raindrops/extconf.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-11 02:12:37 +0000
committerEric Wong <normalperson@yhbt.net>2011-03-11 02:12:37 +0000
commite516e45640206fa3e7864938da74a7cb5ca31715 (patch)
tree199b0eb8786ff310c81c5eb82424f8b0b893ddb3 /ext/raindrops/extconf.rb
parent61962b27a51031965cef70451d369b115868fb11 (diff)
downloadraindrops-e516e45640206fa3e7864938da74a7cb5ca31715.tar.gz
This allows limited resizing of the Raindrops memory
area since we always over-allocate due to the required
page aligment for mmap.

It would be nice if mremap() worked with MAP_SHARED,
but it does not and triggers a bus error when attempting
to access the new area.

ref: https://bugzilla.kernel.org/show_bug.cgi?id=8691
Diffstat (limited to 'ext/raindrops/extconf.rb')
-rw-r--r--ext/raindrops/extconf.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/raindrops/extconf.rb b/ext/raindrops/extconf.rb
index fc2b3fd..08b5f44 100644
--- a/ext/raindrops/extconf.rb
+++ b/ext/raindrops/extconf.rb
@@ -3,6 +3,11 @@ require 'mkmf'
 have_func('mmap', 'sys/mman.h') or abort 'mmap() not found'
 have_func('munmap', 'sys/mman.h') or abort 'munmap() not found'
 
+$CPPFLAGS += " -D_GNU_SOURCE "
+have_func('mremap', 'sys/mman.h')
+
+$CPPFLAGS += " -D_BSD_SOURCE -D_XOPEN_SOURCE=600 "
+have_func("getpagesize", "unistd.h")
 have_func("rb_struct_alloc_noinit")
 have_func('rb_thread_blocking_region')