Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ jobs:
asan.test_modularize_instance_pthreads
asan.test_minimal_runtime_hello_world
asan.test_select_blocking
asan.test_ppoll_blocking
lsan.test_dylink_dso_needed
lsan.test_stdio_locking
lsan.test_dlfcn_basic
Expand Down
4 changes: 2 additions & 2 deletions system/lib/libc/musl/src/select/ppoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ int ppoll(struct pollfd *fds, nfds_t n, const struct timespec *to, const sigset_
// in terms of poll here in userspace.
int timeout = (to == NULL) ? -1 : (to->tv_sec * 1000 + to->tv_nsec / 1000000);
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, mask, &origmask);
if (mask) pthread_sigmask(SIG_SETMASK, mask, &origmask);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it valid to have a null mask? should we return an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, from the ppoll man page:

If the sigmask argument is specified as NULL, then no signal mask manipulation is performed (and thus ppoll() differs from poll() only in the precision of the timeout
argument).

int rtn = poll(fds, n, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
if (mask) pthread_sigmask(SIG_SETMASK, &origmask, NULL);
return rtn;
#else
time_t s = to ? to->tv_sec : 0;
Expand Down
4 changes: 2 additions & 2 deletions system/lib/libc/musl/src/select/pselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ int pselect(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restric
tv_timeout.tv_usec = ts->tv_nsec / 1000;
}
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, mask, &origmask);
if (mask) pthread_sigmask(SIG_SETMASK, mask, &origmask);
int rtn = select(n, rfds, wfds, efds, ts ? &tv_timeout : NULL);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
if (mask) pthread_sigmask(SIG_SETMASK, &origmask, NULL);
return rtn;
#else
syscall_arg_t data[2] = { (uintptr_t)mask, _NSIG/8 };
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_dylink_all.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"a.out.js": 244320,
"a.out.nodebug.wasm": 577447,
"total": 821767,
"a.out.nodebug.wasm": 577506,
"total": 821826,
"sent": [
"IMG_Init",
"IMG_Load",
Expand Down
Loading