mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "张 译仁" <>
To: "" <>
Subject: [musl] Confused length of `sigset_t`
Date: Mon, 27 Jun 2022 15:49:04 +0000	[thread overview]
Message-ID: <> (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/
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 --]

             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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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

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).