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
9 changes: 8 additions & 1 deletion system/lib/libc/musl/arch/emscripten/bits/alltypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,15 @@ typedef struct __locale_struct * locale_t;
#endif


// Musl uses 128 bytes for sigset_t, presumably for some kind of ABI
// compatability with the kernel or GLIBC, but in emscripten we can be precise.
// Since we have _NSIG = 65 which only need 2 `long`s for the bitmask.
// The signals we support are
// 1 - 31 - standard POSIX signals (see emscripten/bits/signal.h)
// 32 - 34 - pthread-specific signals (see pthread_impl.h>
// 35 - 65 - user-defined RT signals (we don't currently have any test coverage of these).
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
typedef struct __sigset_t { unsigned long __bits[2]; } sigset_t;
#define __DEFINED_sigset_t
#endif

Expand Down
9 changes: 8 additions & 1 deletion system/lib/libc/musl/include/alltypes.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;

TYPEDEF struct __locale_struct * locale_t;

TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
// Musl uses 128 bytes for sigset_t, presumably for some kind of ABI
// compatability with the kernel or GLIBC, but in emscripten we can be precise.
// Since we have _NSIG = 65 which only need 2 `long`s for the bitmask.
// The signals we support are
// 1 - 31 - standard POSIX signals (see emscripten/bits/signal.h)
// 32 - 34 - pthread-specific signals (see pthread_impl.h>
// 35 - 65 - user-defined RT signals (we don't currently have any test coverage of these).
TYPEDEF struct __sigset_t { unsigned long __bits[2]; } sigset_t;

STRUCT iovec { void *iov_base; size_t iov_len; };

Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_cxx_lto.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a.out.js": 18563,
"a.out.js.gz": 7666,
"a.out.nodebug.wasm": 101956,
"a.out.nodebug.wasm.gz": 39461,
"a.out.nodebug.wasm.gz": 39460,
"total": 120519,
"total_gz": 47127,
"total_gz": 47126,
"sent": [
"a (emscripten_resize_heap)",
"b (_setitimer_js)",
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": 244300,
"a.out.nodebug.wasm": 577451,
"total": 821751,
"a.out.nodebug.wasm": 577444,
"total": 821744,
"sent": [
"IMG_Init",
"IMG_Load",
Expand Down
1 change: 1 addition & 0 deletions test/core/test_signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void test_sigaction() {

void test_sigemptyset() {
sigset_t s = { 0 };
printf("sizeof sigset_t: %zu\n", sizeof(sigset_t));
assert(sigisemptyset(&s));
sigaddset(&s, SIGUSR1);
assert(!sigisemptyset(&s));
Expand Down
Loading