summaryrefslogtreecommitdiffstats
path: root/regress/lib/libc/sys/t_select.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2020-11-09 23:18:51 +0000
committerbluhm <bluhm@openbsd.org>2020-11-09 23:18:51 +0000
commit7496d4e522746cbdb790e5d784296eedc919f7c1 (patch)
tree4f24ab7f9468f971a1b2effcec2fc7f67d68211c /regress/lib/libc/sys/t_select.c
parentAdd test for dynamic IP assignment via "config address" and "request address". (diff)
downloadwireguard-openbsd-7496d4e522746cbdb790e5d784296eedc919f7c1.tar.xz
wireguard-openbsd-7496d4e522746cbdb790e5d784296eedc919f7c1.zip
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.
Diffstat (limited to 'regress/lib/libc/sys/t_select.c')
-rw-r--r--regress/lib/libc/sys/t_select.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/regress/lib/libc/sys/t_select.c b/regress/lib/libc/sys/t_select.c
index 94ff3d3410c..b10fe874955 100644
--- a/regress/lib/libc/sys/t_select.c
+++ b/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;
}