Fix some issues with select()

This commit is contained in:
Justine Tunney 2023-10-04 09:10:58 -07:00
parent 6918c3ffc2
commit 982dc4db87
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 67 additions and 37 deletions

View file

@ -380,9 +380,10 @@ int main(int argc, char *argv[]) {
sigaddset(&block, SIGHUP);
sigaddset(&block, SIGQUIT);
pthread_attr_t attr;
int pagesz = getauxval(AT_PAGESZ);
unassert(!pthread_attr_init(&attr));
unassert(!pthread_attr_setguardsize(&attr, 4096));
unassert(!pthread_attr_setstacksize(&attr, 65536));
unassert(!pthread_attr_setguardsize(&attr, pagesz));
unassert(!pthread_attr_setsigmask_np(&attr, &block));
pthread_t *th = gc(calloc(threads, sizeof(pthread_t)));
for (i = 0; i < threads; ++i) {