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

Function sysctl_handle_opaque

freebsd/kern/kern_sysctl.c:1813–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1811 */
1812
1813int
1814sysctl_handle_opaque(SYSCTL_HANDLER_ARGS)
1815{
1816 int error, tries;
1817 u_int generation;
1818 struct sysctl_req req2;
1819
1820 /*
1821 * Attempt to get a coherent snapshot, by using the thread
1822 * pre-emption counter updated from within mi_switch() to
1823 * determine if we were pre-empted during a bcopy() or
1824 * copyout(). Make 3 attempts at doing this before giving up.
1825 * If we encounter an error, stop immediately.
1826 */
1827 tries = 0;
1828 req2 = *req;
1829retry:
1830 generation = curthread->td_generation;
1831 error = SYSCTL_OUT(req, arg1, arg2);
1832 if (error)
1833 return (error);
1834 tries++;
1835 if (generation != curthread->td_generation && tries < 3) {
1836 *req = req2;
1837 goto retry;
1838 }
1839
1840 error = SYSCTL_IN(req, arg1, arg2);
1841
1842 return (error);
1843}
1844
1845/*
1846 * Based on on sysctl_handle_int() convert microseconds to a sbintime.

Callers 13

axp2xx_sysctlFunction · 0.85
axp8xx_sysctlFunction · 0.85
aw_thermal_sysctlFunction · 0.85
mv_thermal_sysctlFunction · 0.85
sysctl_kern_clockrateFunction · 0.85
sysctl_kern_msgbufFunction · 0.85
sysctl_kern_profFunction · 0.85
ntp_sysctlFunction · 0.85
sysctl_intrnamesFunction · 0.85
sysctl_intrcntFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected