diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-03-11 15:21:59 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-04-21 15:10:07 -0300 |
commit | 2f6fa80147f0cf74c0d411a0e07c5655deb436b3 (patch) | |
tree | b080b4403905e80808140ecae77bc250654a7fc0 /sysdeps/unix/sysv/linux/test-errno-linux.c | |
parent | 34d49f120df2787788acfdf86769277a1a7ebccb (diff) | |
download | glibc-2f6fa80147f0cf74c0d411a0e07c5655deb436b3.tar.gz glibc-2f6fa80147f0cf74c0d411a0e07c5655deb436b3.tar.xz glibc-2f6fa80147f0cf74c0d411a0e07c5655deb436b3.zip |
linux: Use pthread_sigmask on sigprocmask
With pthread_sigmask on libc.so, it allows implement sigprocmask on top of pthread_sigmask. Checked on x86_64-linux-gnu.
Diffstat (limited to 'sysdeps/unix/sysv/linux/test-errno-linux.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/test-errno-linux.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/test-errno-linux.c b/sysdeps/unix/sysv/linux/test-errno-linux.c index b748f8f2a0..838ccf026f 100644 --- a/sysdeps/unix/sysv/linux/test-errno-linux.c +++ b/sysdeps/unix/sysv/linux/test-errno-linux.c @@ -121,6 +121,17 @@ check_error_in_list (int code, int *codes, size_t count) test_wrp_rv(int, "%d", LIST_FORWARD (experr), syscall, __VA_ARGS__) static int +invalid_sigprocmask_how (void) +{ + int n = 0; + const int how[] = { SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK }; + for (int i = 0; i < array_length (how); i++) + if (how[i] == n) + n++; + return n; +} + +static int do_test (void) { fd_set rs, ws, es; @@ -133,10 +144,13 @@ do_test (void) struct sched_param sch_param; struct timespec ts; struct timeval tv; + sigset_t sigs; unsigned char vec[16]; ss.ss_flags = ~SS_DISABLE; ts.tv_sec = -1; + sigemptyset (&sigs); + int fails = 0; fails |= test_wrp (EINVAL, epoll_create, -1); fails |= test_wrp (EINVAL, epoll_create1, EPOLL_CLOEXEC + 1); @@ -175,6 +189,11 @@ do_test (void) fails |= test_wrp (EBADF, sendfile, -1, -1, &off, 0); fails |= test_wrp (EINVAL, sigaltstack, &ss, NULL); fails |= test_wrp (ECHILD, wait4, -1, &status, 0, NULL); + /* Austin Group issue #1132 states EINVAL should be returned for invalid + how argument iff the new set mask is non-null. And Linux follows the + standard on this regard. */ + fails |= test_wrp (EINVAL, sigprocmask, invalid_sigprocmask_how (), &sigs, + NULL); return fails; } |