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