dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / dtrace / test / tst / common / docsExamples / specopen.d
blobdff3e6227b1bcadf2d1f3b5bddbb424492910220
1 #!/usr/sbin/dtrace -Fs
4 /*
5 * CDDL HEADER START
7 * The contents of this file are subject to the terms of the
8 * Common Development and Distribution License (the "License").
9 * You may not use this file except in compliance with the License.
11 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12 * or http://www.opensolaris.org/os/licensing.
13 * See the License for the specific language governing permissions
14 * and limitations under the License.
16 * When distributing Covered Code, include this CDDL HEADER in each
17 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18 * If applicable, add the following below this CDDL HEADER, with the
19 * fields enclosed by brackets "[]" replaced with your own identifying
20 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * CDDL HEADER END
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * ASSERTION:
34 * Verify doc example 13-1
36 * SECTION:
37 * DocExamples/specopen
40 syscall::open:entry,
41 syscall::open64:entry
43 self->spec = speculation();
44 speculate(self->spec);
46 printf("%s", stringof(copyinstr(arg0)));
49 fbt:::
50 /self->spec/
52 speculate(self->spec);
55 syscall::open:return,
56 syscall::open64:return
57 /self->spec/
59 speculate(self->spec);
60 trace(errno);
63 syscall::open:return,
64 syscall::open64:return
65 /self->spec && errno != 0/
67 commit(self->spec);
68 self->spec = 0;
71 syscall::open:return,
72 syscall::open64:return
73 /self->spec && errno == 0/
75 discard(self->spec);
76 self->spec = 0;