4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
26 tmpin
=/tmp
/tst.fds.$$.d
27 tmpout1
=/tmp
/tst.fds.$$.out1
28 tmpout2
=/tmp
/tst.fds.$$.out2
31 #define DUMPFIELD(fd, fmt, field) \
32 errmsg = "could not dump field"; \
33 printf("%d: field =fmt\n", fd, fds[fd].field);
36 * Note that we are explicitly not looking at fi_mount -- it (by design) does
37 * not work if not running with kernel permissions.
40 DUMPFIELD(fd, %s, fi_name); \
41 DUMPFIELD(fd, %s, fi_dirname); \
42 DUMPFIELD(fd, %s, fi_pathname); \
43 DUMPFIELD(fd, %d, fi_offset); \
44 DUMPFIELD(fd, %s, fi_fs); \
45 DUMPFIELD(fd, %o, fi_oflags);
59 printf("error: %s\n", errmsg);
65 # First, with all privs
67 /usr
/sbin
/dtrace
-q -Cs /dev
/stdin
< $tmpin > $tmpout2
71 # And now with only dtrace_proc and dtrace_user -- the output should be
74 ppriv
-s A
=basic
,dtrace_proc
,dtrace_user $$
76 /usr
/sbin
/dtrace
-q -Cs /dev
/stdin
< $tmpin > $tmpout2
86 if ! cmp $tmpout1 $tmpout2 ; then
90 rm $tmpout1 $tmpout2 $tmpin