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

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 1 12:22:33 PDT 2020


abrachet marked an inline comment as done.
abrachet added inline comments.


================
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;
----------------
sivachandra wrote:
> 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.
Sounds good to use `EFAULT` here and the other `sig*set` functions when the set is null in another patch.


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

https://reviews.llvm.org/D76936





More information about the libc-commits mailing list