chkargs.c revision 8cb74972a66bde0af7b1a957d01e0095b82a8b91
/*
* 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
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <strings.h>
#include <unistd.h>
#include <dtrace.h>
static int g_count;
static int g_errs;
static int g_fd;
static int g_verbose;
static int g_errexit;
static char *g_progname;
static int
{
int i;
(void) printf(" failed to get probe info for "
g_errs++;
return (0);
}
for (i = 0; i < p.dtp_argc; i++) {
arg.dtargd_ndx = i;
(void) printf(" failed to get types for args[%d] "
"of %s:%s:%s:%s [%d]: <%s> -> <%s>\n", i,
g_errs++;
if (g_errexit)
return (-1);
} else if (g_verbose) {
}
}
return (0);
}
int
{
int err, c;
char *p;
g_progname = argv[0];
return (1);
}
switch (c) {
case 'e':
g_errexit++;
break;
case 'v':
g_verbose++;
break;
case 'x':
*p++ = '\0';
return (2);
}
break;
default:
"[-x opt[=arg]] [probedesc]\n", g_progname);
return (2);
}
}
if (argc > 0) {
return (2);
}
}
return (g_errs != 0);
}