2 static char sfs_c_sigSid[] = "@(#)sfs_c_sig.c 2.1 97/10/23";
6 * Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
8 * Standard Performance Evaluation Corporation (SPEC)
9 * 6585 Merchant Place, Suite 100
12 * This product contains benchmarks acquired from several sources who
13 * understand and agree with SPEC's goal of creating fair and objective
14 * benchmarks to measure computer performance.
16 * This copyright notice is placed here only to protect SPEC in the
17 * event the source is misused in any manner that is contrary to the
18 * spirit, the goals and the intent of SPEC.
20 * The source code is provided to the user or company under the license
21 * agreement for the SPEC Benchmark Suite for this product.
24 /*****************************************************************
26 * Copyright 1991,1992 Legato Systems, Inc. *
27 * Copyright 1991,1992 Auspex Systems, Inc. *
28 * Copyright 1991,1992 Data General Corporation *
29 * Copyright 1991,1992 Digital Equipment Corporation *
30 * Copyright 1991,1992 Interphase Corporation *
31 * Copyright 1991,1992 Sun Microsystems, Inc. *
33 *****************************************************************/
36 * ---------------------- sfs_c_sig.c ---------------------
38 * Signal handling. Routines to send and catch signals.
42 * void sfs_startup(int)
44 * void sfs_cleanup(int)
50 * 16-Dec-91 Wittle Created.
55 * ------------------------- Include Files -------------------------
67 #include <sys/types.h>
70 #include <sys/signal.h>
74 #include "sfs_c_def.h"
78 * ------------------------- Signal Handlers -------------------------
85 #if !(defined(_XOPEN_SOURCE) || defined(USE_POSIX_SIGNALS))
86 (void) signal(sig_id, sfs_alarm);
88 if (DEBUG_CHILD_SIGNAL)
89 (void) fprintf(stderr, "%s: caught Signal %d\n", sfs_Myname, sig_id);
90 (void) fflush(stderr);
97 * Catch the parent's "start" signal.
103 #if !(defined(_XOPEN_SOURCE) || defined(USE_POSIX_SIGNALS))
104 (void) signal(SIGUSR1, sfs_startup);
106 if (DEBUG_CHILD_SIGNAL)
107 (void) fprintf(stderr, "%s: caught Signal %d SIGUSR1\n",
111 /* I'm the parent, ignore the signal */
115 * SIGUSR1 is used to make all phase transitions, but we
116 * only want to make the Warmup -> Testrun switch here
118 if (Current_test_phase != Warmup_phase)
121 Current_test_phase = Testrun_phase;
128 * Catch the parent's "stop" signal.
134 #if !(defined(_XOPEN_SOURCE) || defined(USE_POSIX_SIGNALS))
135 (void) signal(SIGUSR2, sfs_stop);
137 if (DEBUG_CHILD_SIGNAL)
138 (void) fprintf(stderr, "%s: caught Signal %d SIGUSR2\n",
143 Current_test_phase = Results_phase;
151 * SIGINT, SIGTERM handler
152 * Clean up and exit due to an error/abort condition.
153 * We assume if NFS_client was valid, then MOUNT_client was also valid.
159 if (DEBUG_CHILD_SIGNAL)
160 (void) fprintf(stderr, "%s: caught Signal %d SIGINT\n",
163 (void) unlink(Logname);
164 if (NFS_client != ((CLIENT *) NULL))
165 clnt_destroy(NFS_client);