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

Function nstosbt

freebsd/sys/time.h:201–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static __inline sbintime_t
202nstosbt(int64_t _ns)
203{
204 sbintime_t sb = 0;
205
206#ifdef KASSERT
207 KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns));
208#endif
209 if (_ns >= SBT_1S) {
210 sb = (_ns / 1000000000) * SBT_1S;
211 _ns = _ns % 1000000000;
212 }
213 /* 9223372037 = ceil(2^63 / 1000000000) */
214 sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31;
215 return (sb);
216}
217
218static __inline int64_t
219sbttous(sbintime_t _sbt)

Callers 3

tstosbtFunction · 0.85
attach_etFunction · 0.85
resettodrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected