003 File Manager
Current Path:
/usr/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs
usr
/
src
/
cddl
/
contrib
/
opensolaris
/
cmd
/
dtrace
/
test
/
tst
/
common
/
funcs
/
📁
..
📄
err.D_FUNC_UNDEF.progenyofbad1.d
(1.11 KB)
📄
err.D_OP_VFPTR.badop.d
(1.13 KB)
📄
err.D_PROTO_ARG.chillbadarg.d
(1.09 KB)
📄
err.D_PROTO_ARG.copyoutbadarg.d
(1.14 KB)
📄
err.D_PROTO_ARG.mobadarg.d
(1.12 KB)
📄
err.D_PROTO_ARG.raisebadarg.d
(1.11 KB)
📄
err.D_PROTO_ARG.tolower.d
(932 B)
📄
err.D_PROTO_ARG.toupper.d
(934 B)
📄
err.D_PROTO_LEN.allocanoarg.d
(1.12 KB)
📄
err.D_PROTO_LEN.badbreakpoint.d
(1.12 KB)
📄
err.D_PROTO_LEN.chilltoofew.d
(1.08 KB)
📄
err.D_PROTO_LEN.chilltoomany.d
(1.1 KB)
📄
err.D_PROTO_LEN.copyoutstrbadarg.d
(1.13 KB)
📄
err.D_PROTO_LEN.copyoutstrtoofew.d
(1.14 KB)
📄
err.D_PROTO_LEN.copyouttoofew.d
(1.12 KB)
📄
err.D_PROTO_LEN.copyouttoomany.d
(1.19 KB)
📄
err.D_PROTO_LEN.motoofew.d
(1.12 KB)
📄
err.D_PROTO_LEN.motoomany.d
(1.14 KB)
📄
err.D_PROTO_LEN.mtabadarg.d
(1.14 KB)
📄
err.D_PROTO_LEN.mtatoofew.d
(1.15 KB)
📄
err.D_PROTO_LEN.mtatoomany.d
(1.17 KB)
📄
err.D_PROTO_LEN.panicbadarg.d
(1.11 KB)
📄
err.D_PROTO_LEN.progenyofbad2.d
(1.13 KB)
📄
err.D_PROTO_LEN.stopbadarg.d
(1.11 KB)
📄
err.D_PROTO_LEN.tolower.d
(925 B)
📄
err.D_PROTO_LEN.tolowertoomany.d
(948 B)
📄
err.D_PROTO_LEN.toupper.d
(925 B)
📄
err.D_PROTO_LEN.touppertoomany.d
(940 B)
📄
err.D_STRINGOF_TYPE.badstringof.d
(1.15 KB)
📄
err.D_VAR_UNDEF.badvar.d
(1.12 KB)
📄
err.badalloca.d
(1.25 KB)
📄
err.badalloca2.d
(1.2 KB)
📄
err.badbcopy.d
(1.32 KB)
📄
err.badbcopy1.d
(1.34 KB)
📄
err.badbcopy2.d
(1.28 KB)
📄
err.badbcopy3.d
(1.27 KB)
📄
err.badbcopy4.d
(1.33 KB)
📄
err.badbcopy5.d
(1.34 KB)
📄
err.badbcopy6.d
(1.04 KB)
📄
err.badchill.d
(1.03 KB)
📄
err.chillbadarg.ksh
(1.36 KB)
📄
err.copyout.d
(1.16 KB)
📄
err.copyoutbadaddr.ksh
(1.45 KB)
📄
err.copyoutstrbadaddr.ksh
(1.45 KB)
📄
err.inet_ntoa6badaddr.d
(1.08 KB)
📄
err.inet_ntoabadaddr.d
(1.07 KB)
📄
err.inet_ntopbadaddr.d
(1.08 KB)
📄
err.inet_ntopbadarg.d
(1.15 KB)
📄
tst.badfreopen.ksh
(1.95 KB)
📄
tst.basename.d
(2.94 KB)
📄
tst.basename.d.out
(4.78 KB)
📄
tst.bcopy.d
(1.42 KB)
📄
tst.chill.ksh
(1.46 KB)
📄
tst.cleanpath.d
(1.74 KB)
📄
tst.cleanpath.d.out
(767 B)
📄
tst.copyin.d
(1.66 KB)
📄
tst.copyinto.d
(1.52 KB)
📄
tst.ddi_pathname.d
(1.66 KB)
📄
tst.default.d
(1.16 KB)
📄
tst.freopen.ksh
(1.95 KB)
📄
tst.ftruncate.ksh
(1.26 KB)
📄
tst.ftruncate.ksh.out
(31 B)
📄
tst.hton.d
(2.03 KB)
📄
tst.index.d
(5.83 KB)
📄
tst.index.d.out
(33.71 KB)
📄
tst.inet_ntoa.d
(1.55 KB)
📄
tst.inet_ntoa.d.out
(48 B)
📄
tst.inet_ntoa6.d
(2.99 KB)
📄
tst.inet_ntoa6.d.out
(84 B)
📄
tst.inet_ntop.d
(4.39 KB)
📄
tst.inet_ntop.d.out
(180 B)
📄
tst.lltostr.d
(1.22 KB)
📄
tst.lltostr.d.out
(70 B)
📄
tst.lltostrbase.d
(1.36 KB)
📄
tst.lltostrbase.d.out
(13.46 KB)
📄
tst.mutex_owned.d
(1.55 KB)
📄
tst.mutex_owner.d
(1.34 KB)
📄
tst.mutex_type_adaptive.d
(1.51 KB)
📄
tst.progenyof.d
(1.48 KB)
📄
tst.rand.d
(1.12 KB)
📄
tst.strchr.d
(1.58 KB)
📄
tst.strchr.d.out
(203 B)
📄
tst.strjoin.d
(1.18 KB)
📄
tst.strjoin.d.out
(17 B)
📄
tst.strstr.d
(2.02 KB)
📄
tst.strstr.d.out
(437 B)
📄
tst.strtok.d
(2.5 KB)
📄
tst.strtok.d.out
(30 B)
📄
tst.strtok_null.d
(1.11 KB)
📄
tst.substr.d
(5 KB)
📄
tst.substr.d.out
(7.8 KB)
📄
tst.substrminate.d
(1.27 KB)
📄
tst.substrminate.d.out
(27 B)
📄
tst.system.d
(1.39 KB)
📄
tst.system.d.out
(430 B)
📄
tst.tolower.d
(1.46 KB)
📄
tst.toupper.d
(1.46 KB)
Editing: tst.index.d
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" #pragma D option quiet struct { string str; string substr; int haspos; int position; } command[int]; int i; BEGIN { command[i].str = "foobarbaz"; command[i].substr = "barbaz"; i++; command[i].str = "foofoofoo"; command[i].substr = "foo"; i++; command[i].str = "boofoofoo"; command[i].substr = "foo"; i++; command[i].str = "foobarbaz"; command[i].substr = "barbazzy"; i++; command[i].str = "foobar"; command[i].substr = "foobar"; i++; command[i].str = "foobar"; command[i].substr = "foobarbaz"; i++; command[i].str = ""; command[i].substr = "foobar"; i++; command[i].str = "foobar"; command[i].substr = ""; i++; command[i].str = ""; command[i].substr = ""; i++; command[i].str = "foo"; command[i].substr = ""; i++; end = j = k = 0; printf("#!/usr/bin/perl\n\nBEGIN {\n"); } tick-1ms /j < i && end == 0/ { command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = -400; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = -1; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = 0; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = strlen(command[j].str) / 2; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = strlen(command[j].str); k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = strlen(command[j].str) + 1; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = strlen(command[j].str) + 2; k++; command[i + k].str = command[j].str; command[i + k].substr = command[j].substr; command[i + k].haspos = 1; command[i + k].position = 400; k++; j++; } tick-1ms /j == i && end == 0/ { end = k; i = 0; } tick-1ms /end != 0 && i < end && !command[i].haspos/ { this->result = index(command[i].str, command[i].substr); printf("\tif (index(\"%s\", \"%s\") != %d) {\n", command[i].str, command[i].substr, this->result); printf("\t\tprintf(\"perl => index(\\\"%s\\\", \\\"%s\\\") = ", command[i].str, command[i].substr); printf("%%d\\n\",\n\t\t index(\"%s\", \"%s\"));\n", command[i].str, command[i].substr); printf("\t\tprintf(\" D => index(\\\"%s\\\", \\\"%s\\\") = ", command[i].str, command[i].substr); printf("%d\\n\");\n", this->result); printf("\t\t$failed++;\n"); printf("\t}\n\n"); } tick-1ms /end != 0 && i < end && !command[i].haspos/ { this->result = rindex(command[i].str, command[i].substr); printf("\tif (rindex(\"%s\", \"%s\") != %d) {\n", command[i].str, command[i].substr, this->result); printf("\t\tprintf(\"perl => rindex(\\\"%s\\\", \\\"%s\\\") = ", command[i].str, command[i].substr); printf("%%d\\n\",\n\t\t rindex(\"%s\", \"%s\"));\n", command[i].str, command[i].substr); printf("\t\tprintf(\" D => rindex(\\\"%s\\\", \\\"%s\\\") = ", command[i].str, command[i].substr); printf("%d\\n\");\n", this->result); printf("\t\t$failed++;\n"); printf("\t}\n\n"); } tick-1ms /end != 0 && i < end && command[i].haspos/ { this->result = index(command[i].str, command[i].substr, command[i].position); printf("\tif (index(\"%s\", \"%s\", %d) != %d) {\n", command[i].str, command[i].substr, command[i].position, this->result); printf("\t\tprintf(\"perl => index(\\\"%s\\\", \\\"%s\\\", %d) = ", command[i].str, command[i].substr, command[i].position); printf("%%d\\n\",\n\t\t index(\"%s\", \"%s\", %d));\n", command[i].str, command[i].substr, command[i].position); printf("\t\tprintf(\" D => index(\\\"%s\\\", \\\"%s\\\", %d) = ", command[i].str, command[i].substr, command[i].position); printf("%d\\n\");\n", this->result); printf("\t\t$failed++;\n"); printf("\t}\n\n"); } tick-1ms /end != 0 && i < end && command[i].haspos/ { this->result = rindex(command[i].str, command[i].substr, command[i].position); printf("\tif (rindex(\"%s\", \"%s\", %d) != %d) {\n", command[i].str, command[i].substr, command[i].position, this->result); printf("\t\tprintf(\"perl => rindex(\\\"%s\\\", \\\"%s\\\", %d) = ", command[i].str, command[i].substr, command[i].position); printf("%%d\\n\",\n\t\t rindex(\"%s\", \"%s\", %d));\n", command[i].str, command[i].substr, command[i].position); printf("\t\tprintf(\" D => rindex(\\\"%s\\\", \\\"%s\\\", %d) = ", command[i].str, command[i].substr, command[i].position); printf("%d\\n\");\n", this->result); printf("\t\t$failed++;\n"); printf("\t}\n\n"); } tick-1ms /end != 0 && ++i == end/ { printf("\texit($failed);\n}\n"); exit(0); }
Upload File
Create Folder