2009-12-20 21:41:50 +01:00
|
|
|
#include "fs.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* no_sys *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int no_sys()
|
|
|
|
{
|
|
|
|
/* Somebody has used an illegal system call number */
|
|
|
|
printf("no_sys: invalid call %d\n", req_nr);
|
|
|
|
return(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* clock_time *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC time_t clock_time()
|
|
|
|
{
|
|
|
|
/* This routine returns the time in seconds since 1.1.1970. MINIX is an
|
|
|
|
* astrophysically naive system that assumes the earth rotates at a constant
|
|
|
|
* rate and that such things as leap seconds do not exist.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int r;
|
|
|
|
clock_t uptime, boottime;
|
|
|
|
|
|
|
|
if ((r = getuptime2(&uptime,&boottime)) != OK)
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("clock_time: getuptme2 failed: %d", r);
|
2009-12-20 21:41:50 +01:00
|
|
|
|
|
|
|
return( (time_t) (boottime + (uptime/sys_hz())));
|
|
|
|
}
|
|
|
|
|