From: "张 译仁" <zyr_ms@outlook.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: [musl] Confused length of `sigset_t`
Date: Mon, 27 Jun 2022 15:49:04 +0000 [thread overview]
Message-ID: <OS3PR01MB557688F859612EEF849912F6ECB99@OS3PR01MB5576.jpnprd01.prod.outlook.com> (raw)
[-- 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 --]
next reply other threads:[~2022-06-27 15:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 15:49 张 译仁 [this message]
2022-06-27 16:18 ` Florian Weimer
2022-06-27 20:27 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OS3PR01MB557688F859612EEF849912F6ECB99@OS3PR01MB5576.jpnprd01.prod.outlook.com \
--to=zyr_ms@outlook.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).