mmap on 4k boundaries

Corinna Vinschen
Tue Jul 8 10:23:00 GMT 2003

On Tue, Jul 08, 2003 at 10:16:37AM +0100, Chris January wrote:
> I can't make a patch for this at the moment, but FYI you can map a section
> on a 4k page bounday using the AT_ROUND_TO_PAGE flag. So on Windows NT, mmap
> should be able to map on a 4k page boundary using this function.
> [...]
> ZwMapViewOfSection(
>     IN HANDLE SectionHandle,
>     IN HANDLE ProcessHandle,
>     IN OUT PVOID *BaseAddress,
>     IN ULONG ZeroBits,
>     IN ULONG CommitSize,
>     IN OUT PULONG ViewSize,
>     IN SECTION_INHERIT InheritDisposition,
>     IN ULONG AllocationType,
>     IN ULONG Protect
>     );

Cool.  You'll probbaly also need ZwCreateSection to get the SECTION_EXTEND
flag but that won't hurt.  Reading the description, I'm inclined to
believe that the AT_EXENDABLE_FILE flag also allows maps bigger than the
file size as on POSIX systems.  Now I'd just need time to investigate...


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

More information about the Cygwin-developers mailing list