More as a note for other cygwin users than a general patch, but it
should work in any case.
The attached patch allow to enable shmem_sysv.
as SHM_R | SHM_W are not defined on cygwin (and on posix) 
Additional advise :on cygwin the SYSV shared memory requires the
cygserver service running, otherwise it will fail as
$ mpirun -n 4 ./hello_c.exe
Bad system call