minix/servers/pfs/utility.c

34 lines
1 KiB
C
Raw Normal View History

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 */
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)
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())));
}