From c369d42df84f5bdabcac9041e6c5680a0cbfeaf9 Mon Sep 17 00:00:00 2001 From: bluhm <> Date: Mon, 9 Nov 2020 23:18:51 +0000 Subject: Sync libc syscall tests with changes in upstream NetBSD. Use #ifdef to document differences to NetBSD behaviour, this helps to track upstream. Mark currently failing test as expected failures. So test programs get compiled and executed, but it shows that further investigation is necceassry. --- src/regress/lib/libc/sys/t_select.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/regress/lib/libc/sys/t_select.c') diff --git a/src/regress/lib/libc/sys/t_select.c b/src/regress/lib/libc/sys/t_select.c index 94ff3d3410..b10fe87495 100644 --- a/src/regress/lib/libc/sys/t_select.c +++ b/src/regress/lib/libc/sys/t_select.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_select.c,v 1.1.1.1 2019/11/19 19:57:04 bluhm Exp $ */ +/* $OpenBSD: t_select.c,v 1.2 2020/11/09 23:18:51 bluhm Exp $ */ /* $NetBSD: t_select.c,v 1.4 2017/01/13 21:18:33 christos Exp $ */ /*- @@ -76,10 +76,18 @@ prmask(const sigset_t *m, char *buf, size_t len) buf[0] = '0'; buf[1] = 'x'; #define N(p, a) (((p) >> ((a) * 4)) & 0xf) - /* Adjusted for OpenBSD, on NetBSD sigset_t is a struct */ +#ifdef __OpenBSD__ + /* On NetBSD sigset_t is a struct */ uint32_t p = (*m); for (size_t k = sizeof(p); k > 0; k--) buf[j++] = xtoa(N(p, k - 1)); +#else + for (size_t i = __arraycount(m->__bits); i > 0; i--) { + uint32_t p = m->__bits[i - 1]; + for (size_t k = sizeof(p); k > 0; k--) + buf[j++] = xtoa(N(p, k - 1)); + } +#endif buf[j] = '\0'; return buf; } -- cgit v1.2.3-55-g6feb