Allow locking nullptr if the length is 0
authorChristopher Dykes <cdykes@fb.com>
Thu, 25 Aug 2016 21:52:05 +0000 (14:52 -0700)
committerFacebook Github Bot 9 <facebook-github-bot-9-bot@fb.com>
Thu, 25 Aug 2016 21:53:36 +0000 (14:53 -0700)
commit19c6708bbcdc5e8f0241b567a1e55dd579d0304a
tree18c462eea20713adc5c612e395764cf4bfaee11a
parent6a7f9395dde570c8dc01ef489da9185170c52385
Allow locking nullptr if the length is 0

Summary:
Because apparently this is valid (and we test it).
This also adds a check in mmap to make sure we aren't passing an invalid handle to `MapViewOfFileEx`.

Reviewed By: yfeldblum

Differential Revision: D3772853

fbshipit-source-id: 11593997a3fb12b7b391c5e52661060b71341aef
folly/portability/SysMman.cpp
folly/portability/SysMman.h