Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2002 18:02:39 +0200
From:      Reifenberger Michael EXT <Michael.Reifenberger.gp@icn.siemens.de>
To:        "'Andrew Gallatin'" <gallatin@cs.duke.edu>, Kenneth Culver <culverk@yumyumyum.org>
Cc:        freebsd-emulation@FreeBSD.ORG
Subject:   AW: implementing linux mmap2 syscall
Message-ID:  <67E0BE167008D31185F60008C7289DA0E13189@MCHH218E>

index | next in thread | raw e-mail

Hi,
BTW: NETBSD seems so have the newer syscalls implemented.
Take a look at:
http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/compat/linux/common/linux_misc.c?rev=1.107&content-type=text/x-cvsweb-markup
versus old mmap at:
http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/compat/linux/common/linux_oldmmap.c?rev=1.58&content-type=text/x-cvsweb-markup

Bye/2
------
Michael Reifenberger - IT, UNIX, R/3-Basis
Work: Michael.Reifenberger@plaut.de    Proj: Michael.Reifenberger.gp@icn.siemens.de
Pers: Michael@Reifenberger.com  Webspace: http://www.reifenberger.com


-----Ursprüngliche Nachricht-----
Von: Andrew Gallatin [mailto:gallatin@cs.duke.edu]
Gesendet: Montag, 22. April 2002 16:07
An: Kenneth Culver
Cc: freebsd-hackers@FreeBSD.ORG; freebsd-emulation@FreeBSD.ORG
Betreff: Re: implementing linux mmap2 syscall



Kenneth Culver writes:
 > static inline unsigned long do_mmap(struct file *file, unsigned long addr,

<..>
 > 		ret = do_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT);
 > out:
 > 	return ret;
 > }
 > 
 > This is what mmap2 does:
 > 
 > andstatic inline long do_mmap2(
 > 	unsigned long addr, unsigned long len,
 > 	unsigned long prot, unsigned long flags,
 > 	unsigned long fd, unsigned long pgoff)
<...>
 > 	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);

 > 
 > So what it looks like to me is that mmap2 expects an offset that's already 
 > page-aligned (I'm not sure if this is the right way to say it), where mmap 
 > doesn't. the FreeBSD code in the linuxulator basically just takes the offset 

To me, it looks like mmap2 takes an offset that's a page index, rather
than a byte position.   Since linux passes the offset with a 32-bit
long, rather than a 64-bit off_t like we do, they need to do this in
order to be able to map offsets larger than 4GB into a file.

For linux_mmap2, I'd think we want to do roughly the same things as
linux_mmap, but with bsd_args.pos = ctob((off_t)linux_args.pos)

Drew

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?67E0BE167008D31185F60008C7289DA0E13189>