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

Function sysctl_wire_old_buffer

freebsd/kern/kern_sysctl.c:2082–2104  ·  view source on GitHub ↗

* Wire the user space destination buffer. If set to a value greater than * zero, the len parameter limits the maximum amount of wired memory. */

Source from the content-addressed store, hash-verified

2080 * zero, the len parameter limits the maximum amount of wired memory.
2081 */
2082int
2083sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
2084{
2085 int ret;
2086 size_t wiredlen;
2087
2088 wiredlen = (len > 0 && len < req->oldlen) ? len : req->oldlen;
2089 ret = 0;
2090 if (req->lock != REQ_WIRED && req->oldptr &&
2091 req->oldfunc == sysctl_old_user) {
2092 if (wiredlen != 0) {
2093 ret = vslock(req->oldptr, wiredlen);
2094 if (ret != 0) {
2095 if (ret != ENOMEM)
2096 return (ret);
2097 wiredlen = 0;
2098 }
2099 }
2100 req->lock = REQ_WIRED;
2101 req->validlen = wiredlen;
2102 }
2103 return (0);
2104}
2105
2106int
2107sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,

Callers 15

sysctl_mac_veriexec_dbFunction · 0.85
sysctl_ieee80211comsFunction · 0.85
udp_pcblistFunction · 0.85
div_pcblistFunction · 0.85
tcp_pcblistFunction · 0.85
sysctl_mfctableFunction · 0.85
sysctl_viflistFunction · 0.85
sysctl_ip_mcast_filtersFunction · 0.85
rip_pcblistFunction · 0.85
sysctl_igmp_statFunction · 0.85

Calls 1

vslockFunction · 0.50

Tested by

no test coverage detected