mmap failure [was: cygrunsrv + sshd + rsync = 20 times too slow -- throttled?]

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Sat Sep 4 23:18:57 GMT 2021


On 2021-09-04 16:37, Ken Brown via Cygwin wrote:
> I've reduced the procps failure to the following test case:
> 
> $ cat mmap_test.c
> #include <unistd.h>
> #include <stdio.h>
> #include <sys/mman.h>
> 
> int
> main ()
> {
>    void *addr;
>    int page_size = getpagesize ();
> 
>    addr = mmap (0, page_size, PROT_READ | PROT_WRITE,
>                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
>    if (addr == MAP_FAILED)
>      perror ("mmap");
> }
> 
> $ gcc mmap_test.c
> 
> $ ./a
> mmap: Invalid argument

Check on Linux and retry on Cygwin without MAP_PRIVATE?
MAP_PRIVATE implies an fd but MAP_ANON does not, and MAP_ANON is in 
Linux(2)/Unix? not POSIX(3p).

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]


More information about the Cygwin mailing list