timex.c revision 03f1883688117e3b8f2eb323b8a5cf129fa0cc8a
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <strings.h>
#include <time.h>
#include <errno.h>
#include <pwd.h>
#define NANOSEC 1000000000
char fname[20];
static int hz;
int nsec_per_tick;
void hmstime(char[]);
void diag(char *);
int
{
int status;
register pid_t p;
int c;
char cmd[80];
char aopt[25];
char eol;
/* check options; */
switch (c) {
case 's': sflg++; break;
case 'o': oflg++; break;
case 'p': pflg++; break;
break;
}
/*
* Check to see if accounting is installed and print a somewhat
* meaninful message if not.
*/
oflg = 0;
pflg = 0;
"Information from -p and -o options not available\n");
" because process accounting is not operational.\n");
}
if (sflg) {
}
if (p == 0) {
exit(1);
}
;
if ((status&0377) != 0)
if (isatty(0))
if (pflg)
if (oflg) {
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
fld[19]);
if (++iline == 3)
for (i = 0; i < nfld; i++) {
== 0)
ichar = i+2;
== 0)
iblok = i+2;
}
if (iline > 4) {
}
}
}
if (oflg)
if (iline > 4)
"\nCHARS TRNSFD = %ld\n"
else
"\nNo process records found!\n");
}
if (sflg) {
}
}
void
long tk; /* number of ticks */
long ss; /* number of seconds */
long mm; /* number of minutes */
long hh; /* number of hours */
total /= 60;
/*
* A negative sign indicates either time travelling backward
* or an overflow in time travelling forward.
* A positive sign indicates either time travelling forward
* or an overflow in time travelling backward.
*/
if (ticks < 0) {
} else {
}
/*
* We display either nothing or the absolute value of the
* number of calculated hours.
*/
if (hh == 0) {
} else {
}
/*
* We display either nothing or the absolute value of the
* number of calculated minutes. If the value is a single-
* digit value, we would pad a '0' before it.
*/
if (mm == 0) {
if (hh == 0) {
} else {
}
} else {
}
/*
* We display the absolute value of the number of
* calculated seconds. If the value is a single-
* digit value, we would pad a '0' before it.
*/
} else {
}
/*
* We display the absolute value of the number of calculated ticks.
*/
}
/*
* hmstime() sets current time in hh:mm:ss string format in stime;
*/
void
{
char *ltime;
}
void
diag(char *s)
{
exit(1);
}