/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Time routines, snagged from libc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <errno.h>
#include <stdio.h>
#include <time.h>
};
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
/*
* Initializes our "clock" to the creation date of /timestamp, which is
* made on the fly for us by the web server. Thereafter, time() will keep
* time sort of up to date.
*/
void
init_boot_time(void)
{
if (start_time == 0) {
prom_panic("init_boot_time: cannot stat /timestamp");
}
}
/*
* Time is crudely incremented.
*/
{
if (start_time == 0)
return (0);
else
return (time_now);
}
struct tm *
{
long days;
int rem;
long y;
long newy;
const int *ip;
while (rem < 0) {
rem += SECS_PER_DAY;
--days;
}
while (rem >= SECS_PER_DAY) {
rem -= SECS_PER_DAY;
++days;
}
y = EPOCH_YEAR;
if (days < 0)
--newy;
LEAPS_THRU_END_OF(y > 0 ? y - 1L : y);
y = newy;
}
return (tmp);
}
/*
* The standalone booter runs in GMT.
*/
struct tm *
{
}
static char *
{
cp++;
if (n >= 10)
else
return (cp);
}
char *
{
char *cp;
const char *ncp;
const int *tp;
cp++;
--tp;
if (t->tm_year < 100) {
/* Common case: "19" already in buffer */
cp += 2;
} else if (t->tm_year < 8100) {
cp--;
} else {
/* Only 4-digit years are supported */
return (NULL);
}
return (cbuf);
}
char *
{
}