1266989Smarkj#! /usr/bin/ksh
2266989Smarkj#
3266989Smarkj#
4266989Smarkj# This file and its contents are supplied under the terms of the
5266989Smarkj# Common Development and Distribution License ("CDDL"), version 1.0.
6266989Smarkj# You may only use this file in accordance with the terms of version
7266989Smarkj# 1.0 of the CDDL.
8266989Smarkj#
9266989Smarkj# A full copy of the text of the CDDL should have accompanied this
10266989Smarkj# source.  A copy of the CDDL is also available via the Internet at
11266989Smarkj# http://www.illumos.org/license/CDDL.
12266989Smarkj#
13266989Smarkj
14266989Smarkj#
15266989Smarkj# Copyright (c) 2013 Joyent, Inc. All rights reserved.
16266989Smarkj#
17266989Smarkj
18266989Smarkj#
19266989Smarkj# We should be able to see both strstr from libc and from ld on an
20266989Smarkj# alternate linkmap.
21266989Smarkj#
22266989Smarkj
23266989Smarkjif [ $# != 1 ]; then
24266989Smarkj        echo expected one argument: '<'dtrace-path'>'
25266989Smarkj        exit 2
26266989Smarkjfi
27266989Smarkj
28266989Smarkjdtrace=$1
29266989Smarkj
30266989Smarkj$dtrace -q -p $$ -s /dev/stdin  <<EOF
31266989Smarkjpid\$target:LM1\`ld.so.1:strstr:entry,
32266989Smarkjpid\$target:libc.so.1:strstr:entry
33266989Smarkj{
34266989Smarkj	exit (0);
35266989Smarkj}
36266989Smarkj
37266989SmarkjBEGIN
38266989Smarkj{
39266989Smarkj	exit (0);
40266989Smarkj}
41266989SmarkjEOF
42266989Smarkjrc=$?
43266989Smarkj
44266989Smarkjexit $rc
45