mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
show errno on FiberError ref #8711
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
867876ab9b
commit
37c05ec3ed
1 changed files with 2 additions and 1 deletions
3
cont.c
3
cont.c
|
@ -568,9 +568,10 @@ fiber_machine_stack_alloc(size_t size)
|
||||||
void *page;
|
void *page;
|
||||||
STACK_GROW_DIR_DETECTION;
|
STACK_GROW_DIR_DETECTION;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
|
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
|
||||||
if (ptr == MAP_FAILED) {
|
if (ptr == MAP_FAILED) {
|
||||||
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
|
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber errno: %d", errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* guard page setup */
|
/* guard page setup */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue