tst.raise3.d revision 178534
1193323Sed/*
2193323Sed * CDDL HEADER START
3193323Sed *
4193323Sed * The contents of this file are subject to the terms of the
5193323Sed * Common Development and Distribution License (the "License").
6193323Sed * You may not use this file except in compliance with the License.
7193323Sed *
8193323Sed * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9193323Sed * or http://www.opensolaris.org/os/licensing.
10193323Sed * See the License for the specific language governing permissions
11193323Sed * and limitations under the License.
12193323Sed *
13193323Sed * When distributing Covered Code, include this CDDL HEADER in each
14193323Sed * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15193323Sed * If applicable, add the following below this CDDL HEADER, with the
16193323Sed * fields enclosed by brackets "[]" replaced with your own identifying
17193323Sed * information: Portions Copyright [yyyy] [name of copyright owner]
18193323Sed *
19193323Sed * CDDL HEADER END
20193323Sed */
21193323Sed
22193323Sed/*
23193323Sed * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24193323Sed * Use is subject to license terms.
25193323Sed */
26193323Sed
27193323Sed#pragma ident	"%Z%%M%	%I%	%E% SMI"
28193323Sed
29193323Sed/*
30193323Sed * ASSERTION:
31193323Sed * 	Positive test for raise
32193323Sed *
33193323Sed * SECTION: Actions and Subroutines/raise()
34193323Sed */
35193323Sed
36193323Sed#pragma D option destructive
37193323Sed
38193323SedBEGIN
39193323Sed{
40193323Sed	/*
41193323Sed	 * Wait no more than a second for the process to call getpid().
42193323Sed	 */
43193323Sed	timeout = timestamp + 1000000000;
44193323Sed}
45193323Sed
46193323Sedsyscall::getpid:entry
47193323Sed/pid == $1/
48193323Sed{
49193323Sed	trace("raised");
50193323Sed	raise(SIGINT);
51193323Sed	/*
52193323Sed	 * Wait no more than half a second for the process to die.
53193323Sed	 */
54193323Sed	timeout = timestamp + 500000000;
55193323Sed}
56193323Sed
57193323Sedsyscall::exit:entry
58193323Sed{
59193323Sed	exit(0);
60193323Sed}
61193323Sed
62193323Sedprofile:::tick-4
63193323Sed/timestamp > timeout/
64193323Sed{
65193323Sed	trace("timed out");
66193323Sed	exit(1);
67193323Sed}
68193323Sed