2009-12-20 21:41:50 +01:00
|
|
|
#include "fs.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* no_sys *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int no_sys(message *pfs_m_in, message *pfs_m_out)
|
2009-12-20 21:41:50 +01:00
|
|
|
{
|
|
|
|
/* Somebody has used an illegal system call number */
|
2010-07-15 15:39:57 +02:00
|
|
|
printf("no_sys: invalid call 0x%x to pfs\n", req_nr);
|
2009-12-20 21:41:50 +01:00
|
|
|
return(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* clock_time *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
time_t clock_time()
|
2009-12-20 21:41:50 +01:00
|
|
|
{
|
|
|
|
/* 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;
|
2010-05-28 11:39:18 +02:00
|
|
|
clock_t uptime; /* Uptime in ticks */
|
|
|
|
time_t boottime;
|
2009-12-20 21:41:50 +01:00
|
|
|
|
2010-05-28 11:39:18 +02:00
|
|
|
if ((r = getuptime2(&uptime, &boottime)) != OK)
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("clock_time: getuptme2 failed: %d", r);
|
2012-02-13 16:28:04 +01:00
|
|
|
|
2009-12-20 21:41:50 +01:00
|
|
|
return( (time_t) (boottime + (uptime/sys_hz())));
|
|
|
|
}
|