mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Confused length of `sigset_t`
@ 2022-06-27 15:49 张 译仁
  2022-06-27 16:18 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: 张 译仁 @ 2022-06-27 15:49 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

When supporting signal handling for my tiny OS, I notice that the defination of `sigset_t` which is used in signal handling is weird.

```
// include/alltypes.h.in
TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
```

128 bytes (16 * long) are used for sigmask​ when 128 bits (2 * long) is enough.

Why? For strange compatibility? In my opinion, `unsigned long __bits[128/sizeof(long)/8]` is more reasonable.

[-- Attachment #2: Type: text/html, Size: 2074 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-27 20:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 15:49 [musl] Confused length of `sigset_t` 张 译仁
2022-06-27 16:18 ` Florian Weimer
2022-06-27 20:27   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).