summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjasoni <jasoni@cvs.openbsd.org>2000-09-10 07:04:21 +0000
committerjasoni <jasoni@cvs.openbsd.org>2000-09-10 07:04:21 +0000
commit6f317b8b0ad00fc840ffd4636ec658b6b48a03d4 (patch)
tree8f9547e1c1737491b869c4f863f526d7a269bd81
parent9ce1dda5056fb18589af3f47d74648460496e489 (diff)
Linux mmap ignores the fd argument when MAP_ANON is on. Always pass -1
to the native mmap system call (in case the linux app doesn't). - From NetBSD
-rw-r--r--sys/compat/linux/linux_misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index c2ff17cdd62..e8e6db8b4d5 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_misc.c,v 1.32 2000/09/07 17:52:24 ericj Exp $ */
+/* $OpenBSD: linux_misc.c,v 1.33 2000/09/10 07:04:20 jasoni Exp $ */
/* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */
/*
@@ -625,7 +625,7 @@ linux_sys_mmap(p, v, retval)
lmap.lm_prot |= VM_PROT_READ;
SCARG(&cma,prot) = lmap.lm_prot;
SCARG(&cma,flags) = flags;
- SCARG(&cma,fd) = lmap.lm_fd;
+ SCARG(&cma,fd) = flags & MAP_ANON ? -1 : lmap.lm_fd;
SCARG(&cma,pad) = 0;
SCARG(&cma,pos) = lmap.lm_pos;