[libc-commits] [PATCH] D76936: [libc] Add sigfillset and sigdelset

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Mar 31 23:05:03 PDT 2020


sivachandra accepted this revision.
sivachandra marked an inline comment as done.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/signal/linux/sigdelset.cpp:19
+int LLVM_LIBC_ENTRYPOINT(sigdelset)(sigset_t *set, int signum) {
+  if (!set || (unsigned)(signum - 1) >= (8 * sizeof(sigset_t))) {
+    llvmlibc_errno = EINVAL;
----------------
Not a blocker but just something which struck my mind as I was reading the POSIX docs again today. POSIX doesn't seem to care about `set == nullptr`. We could still detect an invalid `set` and set a different error may be so that we don't step on POSIX's way of setting `EINVAL` for a bad `signum`. May be `EFAULT`? Whatever we do, we need to do it consistently across all of these related functions. Since `sigaddset` already has similar code, we can keep it as is here for now.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76936/new/

https://reviews.llvm.org/D76936





More information about the libc-commits mailing list