xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/usdt/tst.include.ksh (revision 2769:b2e3d55c6e12)
1*2769Sahl#
2*2769Sahl# CDDL HEADER START
3*2769Sahl#
4*2769Sahl# The contents of this file are subject to the terms of the
5*2769Sahl# Common Development and Distribution License (the "License").
6*2769Sahl# You may not use this file except in compliance with the License.
7*2769Sahl#
8*2769Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2769Sahl# or http://www.opensolaris.org/os/licensing.
10*2769Sahl# See the License for the specific language governing permissions
11*2769Sahl# and limitations under the License.
12*2769Sahl#
13*2769Sahl# When distributing Covered Code, include this CDDL HEADER in each
14*2769Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2769Sahl# If applicable, add the following below this CDDL HEADER, with the
16*2769Sahl# fields enclosed by brackets "[]" replaced with your own identifying
17*2769Sahl# information: Portions Copyright [yyyy] [name of copyright owner]
18*2769Sahl#
19*2769Sahl# CDDL HEADER END
20*2769Sahl#
21*2769Sahl
22*2769Sahl#
23*2769Sahl# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2769Sahl# Use is subject to license terms.
25*2769Sahl#
26*2769Sahl# ident	"%Z%%M%	%I%	%E% SMI"
27*2769Sahl
28*2769Sahl# Make sure <unistd.h> defines _DTRACE_VERSION
29*2769Sahl
30*2769SahlDIR=/var/tmp/dtest.$$
31*2769Sahl
32*2769Sahlmkdir $DIR
33*2769Sahlcd $DIR
34*2769Sahl
35*2769Sahlcat > test.c <<EOF
36*2769Sahl#include <unistd.h>
37*2769Sahl
38*2769Sahlint
39*2769Sahlmain(int argc, char **argv)
40*2769Sahl{
41*2769Sahl#ifdef _DTRACE_VERSION
42*2769Sahl	return (0);
43*2769Sahl#else
44*2769Sahl	return (1);
45*2769Sahl#endif
46*2769Sahl}
47*2769SahlEOF
48*2769Sahl
49*2769Sahlcc -xarch=generic -o test test.c
50*2769Sahlif [ $? -ne 0 ]; then
51*2769Sahl	print -u2 "failed to compile test.c"
52*2769Sahl	exit 1
53*2769Sahlfi
54*2769Sahl
55*2769Sahl./test
56*2769Sahlstatus=$?
57*2769Sahl
58*2769Sahlcd /
59*2769Sahl/usr/bin/rm -rf $DIR
60*2769Sahl
61*2769Sahlexit $status
62