patch-2.3.9 linux/arch/ppc/kernel/syscalls.c
Next file: linux/arch/ppc/kernel/time.c
Previous file: linux/arch/ppc/kernel/smp.c
Back to the patch index
Back to the overall index
- Lines: 26
- Date:
Mon Jun 28 13:40:39 1999
- Orig file:
v2.3.8/linux/arch/ppc/kernel/syscalls.c
- Orig date:
Mon Jun 7 12:11:51 1999
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/syscalls.c linux/arch/ppc/kernel/syscalls.c
@@ -33,6 +33,7 @@
#include <linux/sys.h>
#include <linux/ipc.h>
#include <linux/utsname.h>
+#include <linux/file.h>
#include <asm/uaccess.h>
#include <asm/ipc.h>
@@ -201,12 +202,16 @@
lock_kernel();
if (!(flags & MAP_ANONYMOUS)) {
- if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
+ if (!(file = fget(fd)))
goto out;
}
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+ down(¤t->mm->mmap_sem);
ret = do_mmap(file, addr, len, prot, flags, offset);
+ up(¤t->mm->mmap_sem);
+ if (file)
+ fput(file);
out:
unlock_kernel();
return ret;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)