tst.raise1.d revision 178476
1195609Smp/*
259243Sobrien * CDDL HEADER START
359243Sobrien *
459243Sobrien * The contents of this file are subject to the terms of the
559243Sobrien * Common Development and Distribution License (the "License").
659243Sobrien * You may not use this file except in compliance with the License.
759243Sobrien *
859243Sobrien * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
959243Sobrien * or http://www.opensolaris.org/os/licensing.
1059243Sobrien * See the License for the specific language governing permissions
1159243Sobrien * and limitations under the License.
1259243Sobrien *
1359243Sobrien * When distributing Covered Code, include this CDDL HEADER in each
1459243Sobrien * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1559243Sobrien * If applicable, add the following below this CDDL HEADER, with the
1659243Sobrien * fields enclosed by brackets "[]" replaced with your own identifying
17100616Smp * information: Portions Copyright [yyyy] [name of copyright owner]
1859243Sobrien *
1959243Sobrien * CDDL HEADER END
2059243Sobrien */
2159243Sobrien
2259243Sobrien/*
2359243Sobrien * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2459243Sobrien * Use is subject to license terms.
2559243Sobrien */
2659243Sobrien
2759243Sobrien#pragma ident	"%Z%%M%	%I%	%E% SMI"
2859243Sobrien
2959243Sobrien/*
3059243Sobrien * ASSERTION:
3159243Sobrien * 	Positive test for raise
3259243Sobrien *
3359243Sobrien * SECTION: Actions and Subroutines/raise()
34145479Smp */
3559243Sobrien
36195609Smp#pragma D option destructive
3759243Sobrien
3859243SobrienBEGIN
3959243Sobrien{
4059243Sobrien	/*
4159243Sobrien	 * Wait no more than a second for the process to call getpid().
42167465Smp	 */
43167465Smp	timeout = timestamp + 1000000000;
44167465Smp}
45195609Smp
46167465Smpsyscall::getpid:entry
47167465Smp/pid == $1/
48167465Smp{
49167465Smp	trace("raised");
50167465Smp	raise(SIGINT);
51167465Smp	/*
52167465Smp	 * Wait no more than half a second for the process to die.
53167465Smp	 */
5459243Sobrien	timeout = timestamp + 500000000;
5559243Sobrien}
5659243Sobrien
5759243Sobriensyscall::exit:entry
5859243Sobrien{
5959243Sobrien	exit(0);
60167465Smp}
61167465Smp
62167465Smpprofile:::tick-4
63167465Smp/timestamp > timeout/
64167465Smp{
65167465Smp	trace("timed out");
66167465Smp	exit(1);
67167465Smp}
68167465Smp