155714Skris/*
255714Skris * CDDL HEADER START
355714Skris *
455714Skris * The contents of this file are subject to the terms of the
555714Skris * Common Development and Distribution License (the "License").
655714Skris * You may not use this file except in compliance with the License.
755714Skris *
855714Skris * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
955714Skris * or http://www.opensolaris.org/os/licensing.
1055714Skris * See the License for the specific language governing permissions
1159191Skris * and limitations under the License.
1255714Skris *
13160814Ssimon * When distributing Covered Code, include this CDDL HEADER in each
14160814Ssimon * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15160814Ssimon * If applicable, add the following below this CDDL HEADER, with the
16160814Ssimon * fields enclosed by brackets "[]" replaced with your own identifying
17160814Ssimon * information: Portions Copyright [yyyy] [name of copyright owner]
18160814Ssimon *
19142425Snectar * CDDL HEADER END
2055714Skris */
2155714Skris
2255714Skris/*
2355714Skris * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2455714Skris * Use is subject to license terms.
2555714Skris */
2655714Skris
27142425Snectar#pragma ident	"%Z%%M%	%I%	%E% SMI"
2855714Skris
2955714Skris/*
3055714Skris * ASSERTION: test that all 10 arguments are what we expect them to be.
3155714Skris *
3255714Skris * SECTION: pid provider
33160814Ssimon */
34160814Ssimon
35109998Smarkm#pragma D option destructive
3655714Skris
3755714SkrisBEGIN
3855714Skris{
3955714Skris	/*
4055714Skris	 * Wait no more than a second for the first call to getpid(2).
4155714Skris	 */
4255714Skris	timeout = timestamp + 1000000000;
43109998Smarkm}
44160814Ssimon
45160814Ssimonsyscall::getpid:return
46160814Ssimon/pid == $1/
4755714Skris{
4855714Skris	i = 0;
4955714Skris	raise(SIGUSR1);
5055714Skris	/*
51160814Ssimon	 * Wait half a second after raising the signal.
5255714Skris	 */
5355714Skris	timeout = timestamp + 500000000;
5455714Skris}
5555714Skris
5655714Skrispid$1:a.out:go:entry
5755714Skris/arg0 == 0 && arg1 == 1 && arg2 == 2 && arg3 == 3 && arg4 == 4 &&
5855714Skrisarg5 == 5 && arg6 == 6 && arg7 == 7 && arg8 == 8 && arg9 == 9/
5955714Skris{
6055714Skris	exit(0);
6155714Skris}
6255714Skris
6368651Skrispid$1:a.out:go:entry
6468651Skris{
65109998Smarkm	printf("wrong args: %d %d %d %d %d %d %d %d %d %d", arg0, arg1, arg2,
66162911Ssimon	    arg3, arg4, arg5, arg6, arg7, arg8, arg9);
6755714Skris	exit(1);
6855714Skris}
6955714Skris
7055714Skrisprofile:::tick-4
71109998Smarkm/timestamp > timeout/
72109998Smarkm{
73160814Ssimon	trace("test timed out");
74160814Ssimon	exit(1);
75111147Snectar}
76111147Snectar