summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-01-11 18:46:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-01-11 18:46:31 +0000
commitbdcbae13d3ce5b0ec5f91b1386a97efef538a1c6 (patch)
treece5b4b382611d7c073621a04968901d797b90262 /sys/uvm
parenta1347c5429a4a6569c12b1eac90063472b46882e (diff)
mincore() is a relic from the past, exposing physical machine information
about shared resources which no program should see. only a few pieces of software use it, generally poorly thought out. they are being fixed, so mincore() can be deleted. ok guenther tedu jca sthen, others
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_mmap.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 80d32dbb668..48d23f3880c 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.152 2019/01/10 21:55:26 tedu Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.153 2019/01/11 18:46:30 deraadt Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -168,53 +168,6 @@ sys_mquery(struct proc *p, void *v, register_t *retval)
return (error);
}
-/*
- * sys_mincore: determine if pages are in core or not.
- */
-/* ARGSUSED */
-int
-sys_mincore(struct proc *p, void *v, register_t *retval)
-{
- struct sys_mincore_args /* {
- syscallarg(void *) addr;
- syscallarg(size_t) len;
- syscallarg(char *) vec;
- } */ *uap = v;
- char *pgs;
- vaddr_t start, end;
- vsize_t len, npgs;
- int error = 0;
-
- start = (vaddr_t)SCARG(uap, addr);
- len = SCARG(uap, len);
-
- if (start & PAGE_MASK)
- return (EINVAL);
- len = round_page(len);
- end = start + len;
- if (end <= start)
- return (EINVAL);
-
- npgs = len >> PAGE_SHIFT;
-
- /*
- * < art> Anyone trying to mincore more than 4GB of address space is
- * clearly insane.
- */
- if (npgs >= (0xffffffff >> PAGE_SHIFT))
- return (E2BIG);
- pgs = mallocarray(npgs, sizeof(*pgs), M_TEMP, M_WAITOK | M_CANFAIL);
- if (pgs == NULL)
- return (ENOMEM);
- /*
- * Lie. After all, the answer may change at anytime.
- */
- memset(pgs, 1, npgs * sizeof(*pgs));
- error = copyout(pgs, SCARG(uap, vec), npgs * sizeof(char));
- free(pgs, M_TEMP, npgs * sizeof(*pgs));
- return (error);
-}
-
int uvm_wxabort;
/*