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

Function sys_munlockall

freebsd/vm/vm_mmap.c:1196–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1194#endif
1195
1196int
1197sys_munlockall(struct thread *td, struct munlockall_args *uap)
1198{
1199 vm_map_t map;
1200 int error;
1201
1202 map = &td->td_proc->p_vmspace->vm_map;
1203 error = priv_check(td, PRIV_VM_MUNLOCK);
1204 if (error)
1205 return (error);
1206
1207 /* Clear the MAP_WIREFUTURE flag from this vm_map. */
1208 vm_map_lock(map);
1209 vm_map_modflags(map, 0, MAP_WIREFUTURE);
1210 vm_map_unlock(map);
1211
1212 /* Forcibly unwire all pages. */
1213 error = vm_map_unwire(map, vm_map_min(map), vm_map_max(map),
1214 VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK);
1215#ifdef RACCT
1216 if (racct_enable && error == KERN_SUCCESS) {
1217 PROC_LOCK(td->td_proc);
1218 racct_set(td->td_proc, RACCT_MEMLOCK, 0);
1219 PROC_UNLOCK(td->td_proc);
1220 }
1221#endif
1222
1223 return (error);
1224}
1225
1226#ifndef _SYS_SYSPROTO_H_
1227struct munlock_args {

Callers

nothing calls this directly

Calls 6

vm_map_modflagsFunction · 0.85
vm_map_unwireFunction · 0.85
vm_map_minFunction · 0.85
vm_map_maxFunction · 0.85
priv_checkFunction · 0.50
racct_setFunction · 0.50

Tested by

no test coverage detected