4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# CDDL HEADER START
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# The contents of this file are subject to the terms of the
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# Common Development and Distribution License (the "License").
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# You may not use this file except in compliance with the License.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# or http://www.opensolaris.org/os/licensing.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# See the License for the specific language governing permissions
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# and limitations under the License.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# When distributing Covered Code, include this CDDL HEADER in each
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# If applicable, add the following below this CDDL HEADER, with the
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# fields enclosed by brackets "[]" replaced with your own identifying
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# information: Portions Copyright [yyyy] [name of copyright owner]
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# CDDL HEADER END
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# Use is subject to license terms.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# This test verifies that a program that corrupts its own environment
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# without inducing a crash does not crash solely due to drti.o's use of
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam print -u2 'expected one argument: <dtrace-path>'
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# jdtrace does not implement the -h option that is required to generate
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam# C header files.
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam print -u2 'Could not create safe temporary directory'
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslammain: main.o prov.o
a386cc11a86ecb60f5a48078d22c1500e2ad003eRobert Mustacchi gcc -m32 -o main main.o prov.o
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslammain.o: main.c prov.h
a386cc11a86ecb60f5a48078d22c1500e2ad003eRobert Mustacchi gcc -m32 -c main.c
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslamprov.h: prov.d
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam $dtrace -h -s prov.d
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslamprov.o: prov.d main.o
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam $dtrace -G -32 -s prov.d main.o
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslamprovider tester {
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam probe entry();
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam#include <stdlib.h>
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam#include <sys/sdt.h>
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam#include "prov.h"
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslammain(int argc, char **argv, char **envp)
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam envp[0] = (char*)0xff;
4d27388d47efc322c1d4d64dbd8b40fd48a9a9d1Jonathan Haslam TESTER_ENTRY();