freebsd-dev/usr.sbin/xntpd/lib/machines.c
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00

62 lines
1.0 KiB
C

/* machines.c - provide special support for peculiar architectures
*
* Real bummers unite !
*
* $FreeBSD$
*/
#include "ntp_stdlib.h"
#ifdef SYS_PTX
#include <sys/types.h>
#include <sys/procstats.h>
int
settimeofday(tvp)
struct timeval *tvp;
{
return (stime(&tvp->tv_sec)); /* lie as bad as SysVR4 */
}
int
gettimeofday(tvp)
struct timeval *tvp;
{
/*
* hi, this is Sequents sneak path to get to a clock
* this is also the most logical syscall for such a function
*/
return (get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
(struct procstats *) 0));
}
#endif
#if !defined(NTP_POSIX_SOURCE) || defined(NTP_NEED_BOPS)
void
ntp_memset(a, x, c)
char *a;
int x, c;
{
while (c-- > 0)
*a++ = x;
}
#endif /*POSIX*/
#if defined(USE_CLOCK_SETTIME)
#include <time.h>
int
settimeofday(tvp)
struct timeval *tvp;
{
struct timespec ts;
/* Convert timeval to timespec */
ts.tv_sec = tvp->tv_sec;
ts.tv_nsec = 1000 * tvp->tv_usec;
return clock_settime(CLOCK_REALTIME, &ts);
}
#endif /* USE_CLOCK_SETTIME */