MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_ffclock_setestimate

Function sys_ffclock_setestimate

freebsd/kern/kern_ffclock.c:418–437  ·  view source on GitHub ↗

ARGSUSED */

Source from the content-addressed store, hash-verified

416#endif
417/* ARGSUSED */
418int
419sys_ffclock_setestimate(struct thread *td, struct ffclock_setestimate_args *uap)
420{
421 struct ffclock_estimate cest;
422 int error;
423
424 /* Reuse of PRIV_CLOCK_SETTIME. */
425 if ((error = priv_check(td, PRIV_CLOCK_SETTIME)) != 0)
426 return (error);
427
428 if ((error = copyin(uap->cest, &cest, sizeof(struct ffclock_estimate)))
429 != 0)
430 return (error);
431
432 mtx_lock(&ffclock_mtx);
433 memcpy(&ffclock_estimate, &cest, sizeof(struct ffclock_estimate));
434 ffclock_updated++;
435 mtx_unlock(&ffclock_mtx);
436 return (error);
437}
438
439/*
440 * System call allowing userland applications to retrieve the clock estimates

Callers

nothing calls this directly

Calls 5

priv_checkFunction · 0.70
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
copyinFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected