From 192a7b5f9ef64815200a192c5d8da321e8b1dac1 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 21 Oct 2014 17:56:06 +0000 Subject: [PATCH] Port lib/libc/gen/t_siginfo to FreeBSD - mcontext_t on FreeBSD doesn't have a __gregs field (it's split out on FreeBSD into separate fields). In order to avoid muddying the test code with MD code, the debugging trace info has not been implemented - FreeBSD does not implement the si_stime and si_utime fields in siginfo_t, so omit the debugging code that dumps the values - sys/inttypes.h doesn't exist on FreeBSD Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/gen/t_siginfo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c index 2fb53e48a1d..e8026214ed0 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c @@ -29,7 +29,9 @@ #include #include +#if defined(__NetBSD__) #include +#endif #include #include #include @@ -86,9 +88,11 @@ sig_debug(int signo, siginfo_t *info, ucontext_t *ctx) printf("uc_stack %p %lu 0x%x\n", ctx->uc_stack.ss_sp, (unsigned long)ctx->uc_stack.ss_size, ctx->uc_stack.ss_flags); +#if defined(__NetBSD__) for (i = 0; i < __arraycount(ctx->uc_mcontext.__gregs); i++) printf("uc_mcontext.greg[%d] 0x%lx\n", i, (long)ctx->uc_mcontext.__gregs[i]); +#endif } } @@ -141,8 +145,10 @@ sigchild_action(int signo, siginfo_t *info, void *ptr) printf("si_uid=%d\n", info->si_uid); printf("si_pid=%d\n", info->si_pid); printf("si_status=%d\n", info->si_status); +#if defined(__NetBSD__) printf("si_utime=%lu\n", (unsigned long int)info->si_utime); printf("si_stime=%lu\n", (unsigned long int)info->si_stime); +#endif } ATF_REQUIRE_EQ(info->si_code, code); ATF_REQUIRE_EQ(info->si_signo, SIGCHLD);