kernels/linux-2.4.0/arch/arm/kernel/sys_arm.c
/* common code for old and new mmaps */
common code for old and new mmaps
common code for old and new mmaps
inline long do_mmap2(
	unsigned long addr, unsigned long len,
	unsigned long prot, unsigned long flags,
	unsigned long fd, unsigned long pgoff)
{
	int error = -EBADF;
	struct file * file = NULL;
	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
	if (!(flags & MAP_ANONYMOUS)) {
		file = fget(fd);
		if (!file)
			goto out;
	}
	down(&current->mm->mmap_sem);
	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
	up(&current->mm->mmap_sem);
	if (file)
		fput(file);
out:
	return error;
}
inline long do_mmap2 ( unsigned long addr , unsigned long len , unsigned long prot , unsigned long flags , unsigned long fd , unsigned long pgoff ) { int error = - EBADF ; struct file * file = NULL ; flags &= ~ ( MAP_EXECUTABLE | MAP_DENYWRITE ) ; if ( ! ( flags & MAP_ANONYMOUS ) ) { file = fget ( fd ) ; if ( ! file ) goto out ; } down ( & current -> mm -> mmap_sem ) ; error = do_mmap_pgoff ( file , addr , len , prot , flags , pgoff ) ; up ( & current -> mm -> mmap_sem ) ; if ( file ) fput ( file ) ; out : return error ; }
common code for old and new mmaps
common code for old and new mmaps