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

Ken Brown
Tue Sep 7 22:44:54 GMT 2021

On 9/7/2021 5:52 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
>>> With undocumented structure member initialization an issue, maybe better to
>>> future proof using e.g.
>>>       MEM_EXTENDED_PARAMETER mmap_ext = { 0 }; // or memset or bzero
>> I don't see what this would accomplish.  We're already initializing every member
>> after Corinna's last patch.
> Well, if one day MS decides to use some of the Reserved field by splinting off a new
> named field out of that bulk of bits, the code will be in trouble again...
> While with memset, bzero or C-style initializer, everything is guaranteed to be zapped with 0.

MS can't add a new named field to a documented struct without breaking a lot of 
code.  I think it's extremely unlikely that they would do that.  On the other 
hand, I think it's very likely that a reader of the Cygwin code would be 
confused by code that initializes a struct to 0 prior to assigning a value to 
every member.


More information about the Cygwin mailing list