}
/*
- * does not implement security features of kern_time.c:settime()
- */
-void
-afs_osi_SetTime(osi_timeval_t * atv)
-{
- printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
-}
-
-/*
* Replace all of the bogus special-purpose memory allocators...
*/
void *
{
return EINVAL;
}
-
-/*
- * just calls kern_time.c:settime()
- */
-void
-afs_osi_SetTime(osi_timeval_t *atv)
-{
-#if 0
- printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
-#else
- struct timespec ts;
- AFS_GUNLOCK();
- ts.tv_sec = atv->tv_sec;
- ts.tv_nsec = atv->tv_usec * 1000;
- settime(osi_curproc()->l_proc, &ts); /* really takes a process */
- AFS_GLOCK();
-#endif
-}
return now.tv_sec;
}
-void
-afs_osi_SetTime(osi_timeval_t * atv)
-{
- printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
-}
-
/* cancel osi_Wait */
void
afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle)
* These are no-ops in user space
*/
-void
-afs_osi_SetTime(osi_timeval_t * atv)
-{
- return;
-}
-
/*
* xflock should never fall through, the only files we know
* about are AFS files
#endif
}
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
-/* set the real time */
-void
-afs_osi_SetTime(osi_timeval_t * atv)
-{
-#if defined(AFS_AIX32_ENV)
- struct timestruc_t t;
-
- t.tv_sec = atv->tv_sec;
- t.tv_nsec = atv->tv_usec * 1000;
- ksettimer(&t); /* Was -> settimer(TIMEOFDAY, &t); */
-#elif defined(AFS_SUN5_ENV)
- stime(atv->tv_sec);
-#elif defined(AFS_SGI_ENV)
- struct stimea {
- sysarg_t time;
- } sta;
-
- AFS_GUNLOCK();
- sta.time = atv->tv_sec;
- stime(&sta);
- AFS_GLOCK();
-#elif defined(AFS_DARWIN_ENV)
-#ifndef AFS_DARWIN80_ENV
- AFS_GUNLOCK();
- setthetime(atv);
- AFS_GLOCK();
-#endif
-#else
- /* stolen from kern_time.c */
-#ifndef AFS_AUX_ENV
- boottime.tv_sec += atv->tv_sec - time.tv_sec;
-#endif
-#ifdef AFS_HPUX_ENV
- {
-#if !defined(AFS_HPUX1122_ENV)
- /* drop the setting of the clock for now. spl7 is not
- * known on hpux11.22
- */
- ulong_t s;
- struct timeval t;
- t.tv_sec = atv->tv_sec;
- t.tv_usec = atv->tv_usec;
- s = spl7();
- time = t;
- (void)splx(s);
- resettodr(atv);
-#endif
- }
-#else
- {
- int s;
- s = splclock();
- time = *atv;
- (void)splx(s);
- }
- resettodr();
-#endif
-#ifdef AFS_AUX_ENV
- logtchg(atv->tv_sec);
-#endif
-#endif /* AFS_DARWIN_ENV */
- AFS_STATCNT(osi_SetTime);
-}
-#endif /* AFS_LINUX20_ENV */
-
-
void
shutdown_osi(void)
{