Re:Why Ruby App Servers Break on MacOS High Sierra
by fanf2 on Thursday October 19, 2017 @06:59AM
(#15506879)
Surely that gets(sbrk(0)) will not work since sbrk(0) returns a pointer to unmapped memory. Maybe you wanted sbrk(BUFSIZ)?
[ Parent
| on HN ]
Re:Why Ruby App Servers Break on MacOS High Sierra
by geocar on Thursday October 19, 2017 @07:47AM
(#15507055)
Well, no actually: That still limits you to a gets of BUFSIZ.
Just as we often grow the stack with page faults, you could grow the heap with page faults: Modern UNIX doesn't because this is another one of those "almost certainly a mistake", but:
signal(SIGSEGV, grow);
void grow(int _) { sbrk(PAGESZ); }
should work.