Sun Microsystems Netra CP2500 Programming Manual page 32

For the solaris operating system
Table of Contents

Advertisement

System Watchdog Node Management Code Example (Continued)
CODE EXAMPLE 1-1
return (err);
}
int
main(int argc, char **argv)
{
int
int
char
char
char
char
char
int
int
(void) setlocale(LC_ALL, "");
if ((prog = strrchr(argv[0], '/')) == NULL)
else
bzero(timeout, PICL_CLASSNAMELEN_MAX);
bzero(action, PICL_CLASSNAMELEN_MAX);
while ((c = getopt(argc, argv, "hlc:o:m:t:a:")) != EOF) {
18
Netra CP2500 Board Programming Guide • March 2007
err;
c, rc = 0;
cntrl_name[PICL_CLASSNAMELEN_MAX];
op[PICL_CLASSNAMELEN_MAX];
wd_name[PICL_CLASSNAMELEN_MAX];
timeout[PICL_CLASSNAMELEN_MAX];
action[PICL_CLASSNAMELEN_MAX];
cflg = 0, oflg = 0, lflg = 0;
mflg = 0, tflg = 0, aflg = 0;
prog = argv[0];
prog++;
switch (c) {
case 'l':
lflg = 1;
break;
case 'c':
cflg = 1;
(void) strlcpy(cntrl_name, optarg,
PICL_CLASSNAMELEN_MAX);
break;
case 'o':
oflg = 1;
(void) strlcpy(op, optarg,
PICL_CLASSNAMELEN_MAX);
break;
case 'm':
mflg = 1;
(void) strlcpy(wd_name, optarg,
PICL_CLASSNAMELEN_MAX);
break;
case 't':

Advertisement

Table of Contents
loading

Table of Contents