12633Sahl/*
22633Sahl * CDDL HEADER START
32633Sahl *
42633Sahl * The contents of this file are subject to the terms of the
52633Sahl * Common Development and Distribution License (the "License").
62633Sahl * You may not use this file except in compliance with the License.
72633Sahl *
82633Sahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92633Sahl * or http://www.opensolaris.org/os/licensing.
102633Sahl * See the License for the specific language governing permissions
112633Sahl * and limitations under the License.
122633Sahl *
132633Sahl * When distributing Covered Code, include this CDDL HEADER in each
142633Sahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152633Sahl * If applicable, add the following below this CDDL HEADER, with the
162633Sahl * fields enclosed by brackets "[]" replaced with your own identifying
172633Sahl * information: Portions Copyright [yyyy] [name of copyright owner]
182633Sahl *
192633Sahl * CDDL HEADER END
202633Sahl */
212633Sahl
222633Sahl/*
23*4926Sjhaslam * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
242633Sahl * Use is subject to license terms.
252633Sahl */
262633Sahl
272633Sahl
28*4926Sjhaslam# ident	"%Z%%M%	%I%	%E% SMI"
292633Sahl
302633Sahl
312633Sahldtrace_script()
322633Sahl{
332633Sahl
342633Sahl	$dtrace -w -s /dev/stdin <<EOF
352633Sahl
362633Sahl	/*
372633Sahl 	* ASSERTION:
382633Sahl 	*	Verify that copyout() handles bad addresses.
392633Sahl 	*
402633Sahl 	* SECTION: Actions and Subroutines/copyout()
412633Sahl 	* 
422633Sahl 	*/
432633Sahl
442633Sahl	BEGIN 
452633Sahl	{
462633Sahl        	ptr = alloca(sizeof (char *));
472633Sahl        	copyinto(curpsinfo->pr_envp, sizeof (char *), ptr);
482633Sahl        	copyout(ptr, 0, sizeof (char *));
492633Sahl	}
502633Sahl
512633Sahl	ERROR
522633Sahl	{
532633Sahl		exit(1)
542633Sahl	}
552633SahlEOF
562633Sahl}
572633Sahl
582804Stomeeif [ $# != 1 ]; then
592804Stomee	echo expected one argument: '<'dtrace-path'>'
602804Stomee	exit 2
612804Stomeefi
622804Stomee
632804Stomeedtrace=$1
642633Sahl
652633Sahldtrace_script &
662633Sahlchild=$!
672633Sahl
682633Sahlwait $child
692633Sahlstatus=$?
702633Sahl
712633Sahlexit $status
72