Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/lib/libc/siginfo The siginfo tests have migrated to ...
details: https://anonhg.NetBSD.org/src/rev/fc94dd1e5827
branches: trunk
changeset: 760043:fc94dd1e5827
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sat Dec 25 01:08:36 2010 +0000
description:
The siginfo tests have migrated to atf in src/tests/lib/libc/gen/
diffstat:
regress/lib/libc/siginfo/Makefile | 5 -
regress/lib/libc/siginfo/sigalrm/Makefile | 10 --
regress/lib/libc/siginfo/sigalrm/sigalrm.c | 59 ------------
regress/lib/libc/siginfo/sigchld/Makefile | 10 --
regress/lib/libc/siginfo/sigchld/sigchld.c | 132 -----------------------------
regress/lib/libc/siginfo/sigfpe/Makefile | 10 --
regress/lib/libc/siginfo/sigfpe/sigfpe.c | 68 --------------
regress/lib/libc/siginfo/sigsegv/Makefile | 10 --
regress/lib/libc/siginfo/sigsegv/sigsegv.c | 57 ------------
9 files changed, 0 insertions(+), 361 deletions(-)
diffs (truncated from 397 to 300 lines):
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/Makefile
--- a/regress/lib/libc/siginfo/Makefile Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# $NetBSD: Makefile,v 1.2 2009/02/17 19:05:22 christos Exp $
-
-SUBDIR+= sigalrm sigchld sigfpe sigsegv
-
-.include <bsd.subdir.mk>
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigalrm/Makefile
--- a/regress/lib/libc/siginfo/sigalrm/Makefile Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/09/14 06:55:01 christos Exp $
-
-NOMAN= # defined
-
-PROG= sigalrm
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigalrm/sigalrm.c
--- a/regress/lib/libc/siginfo/sigalrm/sigalrm.c Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/* $NetBSD: sigalrm.c,v 1.6 2007/05/21 20:18:01 dogcow Exp $ */
-
-#include <sys/time.h>
-#include <sys/ucontext.h>
-
-#include <assert.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void
-sigalrm(int signo, siginfo_t *info, void *ptr)
-{
-#ifdef DEBUG
- printf("%d %p %p\n", signo, info, ptr);
- if (info != NULL) {
- printf("si_signo=%d\n", info->si_signo);
- printf("si_errno=%d\n", info->si_errno);
- printf("si_code=%d\n", info->si_code);
- printf("si_value.sival_int=%d\n", info->si_value.sival_int);
- }
- if (ptr != NULL) {
- ucontext_t *ctx = ptr;
- int i;
- mcontext_t *mc = &ctx->uc_mcontext;
- printf("uc_flags 0x%x\n", ctx->uc_flags);
- printf("uc_link %p\n", ctx->uc_link);
- for (i = 0; i < sizeof(ctx->uc_sigmask.__bits) /
- sizeof(ctx->uc_sigmask.__bits[0]); i++)
- printf("uc_sigmask[%d] 0x%x\n", i,
- ctx->uc_sigmask.__bits[i]);
- 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);
- for (i = 0; i < sizeof(mc->__gregs)/sizeof(mc->__gregs[0]); i++)
- printf("uc_mcontext.greg[%d] 0x%x\n", i,
- mc->__gregs[i]);
- }
-#endif
- assert(info->si_signo == SIGALRM);
- assert(info->si_code == SI_TIMER);
- assert(info->si_value.sival_int == ITIMER_REAL);
- exit(0);
-}
-
-int
-main(void)
-{
- struct sigaction sa;
- sa.sa_flags = SA_SIGINFO;
- sa.sa_sigaction = sigalrm;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGALRM, &sa, NULL);
- for (;;) {
- alarm(1);
- sleep(1);
- }
- return 0;
-}
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigchld/Makefile
--- a/regress/lib/libc/siginfo/sigchld/Makefile Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/09/14 05:38:41 christos Exp $
-
-NOMAN= # defined
-
-PROG= sigchld
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigchld/sigchld.c
--- a/regress/lib/libc/siginfo/sigchld/sigchld.c Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/* $NetBSD: sigchld.c,v 1.7 2006/11/04 00:08:34 oster Exp $ */
-
-#include <sys/ucontext.h>
-#include <sys/wait.h>
-#include <sys/resource.h>
-
-#include <assert.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-pid_t child;
-int code;
-int status;
-
-void
-handler(int signo, siginfo_t *info, void *ptr)
-{
-#ifdef DEBUG
- if (info != NULL) {
- printf("info=%p\n", info);
- printf("ptr=%p\n", ptr);
- printf("si_signo=%d\n", info->si_signo);
- printf("si_errno=%d\n", info->si_errno);
- printf("si_code=%d\n", info->si_code);
- printf("si_uid=%d\n", info->si_uid);
- printf("si_pid=%d\n", info->si_pid);
- printf("si_status=%d\n", info->si_status);
- printf("si_utime=%d\n", info->si_utime);
- printf("si_stime=%d\n", info->si_stime);
- }
-#endif
- assert(info->si_code == code);
- assert(info->si_signo == SIGCHLD);
- assert(info->si_uid == getuid());
- assert(info->si_pid == child);
- if (WIFEXITED(info->si_status))
- assert(WEXITSTATUS(info->si_status) == status);
- else if (WIFSTOPPED(info->si_status))
- assert(WSTOPSIG(info->si_status) == status);
- else if (WIFSIGNALED(info->si_status))
- assert(WTERMSIG(info->si_status) == status);
-}
-
-static void
-sethandler(void (*action)(int, siginfo_t *, void *))
-{
- struct sigaction sa;
- sa.sa_flags = SA_SIGINFO;
- sa.sa_sigaction = action;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGCHLD, &sa, NULL);
-}
-
-
-static void
-runnormal()
-{
- sigset_t set;
- status = 25;
- code = CLD_EXITED;
-
- switch ((child = fork())) {
- case 0:
- sleep(1);
- exit(status);
- case -1:
- err(1, "fork");
- default:
- sigemptyset(&set);
- sigsuspend(&set);
- }
-}
-
-static void
-rundump()
-{
- sigset_t set;
- status = SIGSEGV;
- code = CLD_DUMPED;
-
- switch ((child = fork())) {
- case 0:
- sleep(1);
- *(long *)0 = 0;
- break;
- case -1:
- err(1, "fork");
- default:
- sigemptyset(&set);
- sigsuspend(&set);
- }
-}
-
-static void
-runkill()
-{
- sigset_t set;
- status = SIGPIPE;
- code = CLD_KILLED;
-
- switch ((child = fork())) {
- case 0:
- sigemptyset(&set);
- sigsuspend(&set);
- break;
- case -1:
- err(1, "fork");
- default:
- kill(child, SIGPIPE);
- sigemptyset(&set);
- sigsuspend(&set);
- }
-}
-int
-main(void)
-{
- sigset_t set;
- struct rlimit rlim;
- (void)getrlimit(RLIMIT_CORE, &rlim);
- rlim.rlim_cur = rlim.rlim_max;
- (void)setrlimit(RLIMIT_CORE, &rlim);
- sethandler(handler);
- sigemptyset(&set);
- sigaddset(&set, SIGCHLD);
- sigprocmask(SIG_BLOCK, &set, NULL);
- runnormal();
- rundump();
- runkill();
-
- return 0;
-}
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigfpe/Makefile
--- a/regress/lib/libc/siginfo/sigfpe/Makefile Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2009/02/17 19:05:22 christos Exp $
-
-NOMAN= # defined
-
-PROG= sigfpe
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r 69f58f8dd40d -r fc94dd1e5827 regress/lib/libc/siginfo/sigfpe/sigfpe.c
--- a/regress/lib/libc/siginfo/sigfpe/sigfpe.c Sat Dec 25 01:04:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/* $NetBSD: sigfpe.c,v 1.2 2009/02/17 19:22:43 christos Exp $ */
-
-#include <sys/time.h>
-#include <sys/ucontext.h>
-
-#include <assert.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#ifndef __vax__
-#include <ieeefp.h>
-#endif
-
-sig_atomic_t z = 0;
-
-void
-sigfpe(int signo, siginfo_t *info, void *ptr)
-{
-#ifdef DEBUG
- printf("%d %p %p\n", signo, info, ptr);
- if (info != NULL) {
- printf("si_signo=%d\n", info->si_signo);
- printf("si_errno=%d\n", info->si_errno);
- printf("si_code=%d\n", info->si_code);
- printf("si_value.sival_int=%d\n", info->si_value.sival_int);
- }
- if (ptr != NULL) {
- ucontext_t *ctx = ptr;
- int i;
- mcontext_t *mc = &ctx->uc_mcontext;
- printf("uc_flags 0x%x\n", ctx->uc_flags);
- printf("uc_link %p\n", ctx->uc_link);
- for (i = 0; i < sizeof(ctx->uc_sigmask.__bits) /
- sizeof(ctx->uc_sigmask.__bits[0]); i++)
- printf("uc_sigmask[%d] 0x%x\n", i,
- ctx->uc_sigmask.__bits[i]);
- 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);
- for (i = 0; i < sizeof(mc->__gregs)/sizeof(mc->__gregs[0]); i++)
- printf("uc_mcontext.greg[%d] 0x%x\n", i,
- mc->__gregs[i]);
- }
-#endif
- assert(z++ == 0);
Home |
Main Index |
Thread Index |
Old Index