Path: utzoo!utgpu!watserv1!watmath!iuvax!mailrus!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: What new system calls do you want in BSD? Message-ID: <2876@auspex.auspex.com> Date: 1 Feb 90 19:27:51 GMT References: <12157@stealth.acf.nyu.edu> <23527@stealth.acf.nyu.edu> <-AE1R04xds13@ficc.uu.net> <2863@auspex.auspex.com> <12067@smoke.BRL.MIL> Organization: Auspex Systems, Santa Clara Lines: 20 >>> vm_offset_t *addr; /* Where to map to (page aligned) */ >>Yes, and so do SunOS 4.x and System V Release 4. What's more, both of >>them implement "mmap", which bears a startling resemblance to "map_fd". > >For a user-mode function, I strongly dislike the page-alignment constraint. >Does mmap have a similar requirement? Yes. The SunOS 4.x/S5R4 VM subsystem implements "mmap()" as an interface to the VM system's mechanism for setting up mappings between pages in your address space and objects such as files; given that said VM mechanism can't, for example, say "bytes 23 through 47 of this particular page are backed by bytes from thus-and-such a vnode", it requires that the address be page-aligned. (I.e., if you really mean "map", there's a *lot* of work involved in lifting the page-alignment restriction.) However, "mmap()" lets you ask the system to assign an address, which is almost always what you want, so applications don't need to worry about page alignment. (If they need to get a page-aligned address, they can use "getpagesize()" and work from there.)