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>

next in thread | raw e-mail | index | archive | help
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=3D1.107&content-type=3Dtext/x-cvsweb-markup
versus old mmap at:
http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/compat/linux/common/linux=
_oldmmap.c?rev=3D1.58&content-type=3Dtext/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=FCngliche 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 =3D do_mmap_pgoff(file, addr, len, prot, flag, offset >> =
PAGE_SHIFT);
 > out:
 > 	return ret;
 > }
 >=20
 > This is what mmap2 does:
 >=20
 > andstatic inline long do_mmap2(
 > 	unsigned long addr, unsigned long len,
 > 	unsigned long prot, unsigned long flags,
 > 	unsigned long fd, unsigned long pgoff)
<...>
 > 	error =3D do_mmap_pgoff(file, addr, len, prot, flags, pgoff);

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

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 =3D 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




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