2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# CDDL HEADER START
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# The contents of this file are subject to the terms of the
2b6e762c557496a41438c0b105d604f60c593682ahl# Common Development and Distribution License (the "License").
2b6e762c557496a41438c0b105d604f60c593682ahl# You may not use this file except in compliance with the License.
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2b6e762c557496a41438c0b105d604f60c593682ahl# or http://www.opensolaris.org/os/licensing.
2b6e762c557496a41438c0b105d604f60c593682ahl# See the License for the specific language governing permissions
2b6e762c557496a41438c0b105d604f60c593682ahl# and limitations under the License.
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# When distributing Covered Code, include this CDDL HEADER in each
2b6e762c557496a41438c0b105d604f60c593682ahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2b6e762c557496a41438c0b105d604f60c593682ahl# If applicable, add the following below this CDDL HEADER, with the
2b6e762c557496a41438c0b105d604f60c593682ahl# fields enclosed by brackets "[]" replaced with your own identifying
2b6e762c557496a41438c0b105d604f60c593682ahl# information: Portions Copyright [yyyy] [name of copyright owner]
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# CDDL HEADER END
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2b6e762c557496a41438c0b105d604f60c593682ahl# Use is subject to license terms.
2b6e762c557496a41438c0b105d604f60c593682ahl#
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahl# Make sure <unistd.h> defines _DTRACE_VERSION
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlDIR=/var/tmp/dtest.$$
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlmkdir $DIR
2b6e762c557496a41438c0b105d604f60c593682ahlcd $DIR
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlcat > test.c <<EOF
2b6e762c557496a41438c0b105d604f60c593682ahl#include <unistd.h>
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlint
2b6e762c557496a41438c0b105d604f60c593682ahlmain(int argc, char **argv)
2b6e762c557496a41438c0b105d604f60c593682ahl{
2b6e762c557496a41438c0b105d604f60c593682ahl#ifdef _DTRACE_VERSION
2b6e762c557496a41438c0b105d604f60c593682ahl return (0);
2b6e762c557496a41438c0b105d604f60c593682ahl#else
2b6e762c557496a41438c0b105d604f60c593682ahl return (1);
2b6e762c557496a41438c0b105d604f60c593682ahl#endif
2b6e762c557496a41438c0b105d604f60c593682ahl}
2b6e762c557496a41438c0b105d604f60c593682ahlEOF
2b6e762c557496a41438c0b105d604f60c593682ahl
c090e5dfb10cc96e71e6b0f55bf98c18027b002cBryan Cantrillgcc -m32 -o test test.c
2b6e762c557496a41438c0b105d604f60c593682ahlif [ $? -ne 0 ]; then
2b6e762c557496a41438c0b105d604f60c593682ahl print -u2 "failed to compile test.c"
2b6e762c557496a41438c0b105d604f60c593682ahl exit 1
2b6e762c557496a41438c0b105d604f60c593682ahlfi
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahl./test
2b6e762c557496a41438c0b105d604f60c593682ahlstatus=$?
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlcd /
2b6e762c557496a41438c0b105d604f60c593682ahl/usr/bin/rm -rf $DIR
2b6e762c557496a41438c0b105d604f60c593682ahl
2b6e762c557496a41438c0b105d604f60c593682ahlexit $status