add makeSystemError*() helper functions
Summary:
Add makeSystemError() helper functions that are similar to the existing
throwSystemError() functions but just return the exception rather than throwing
it. This is helpful for callers using folly::Expected or folly::Future, where
they need to return an exception type rather than throwing it.
This also includes comments about the fact that this code is using the wrong
error category. The C++ standard indicates that std::generic_category() for
POSIX errno values. I am not fixing this as part of this diff, since this
change has the potential to break existing users, and would need a fair amount
of testing first.
Reviewed By: yfeldblum
Differential Revision:
D6456771
fbshipit-source-id:
4724b51b8d4a7f513ae70ea1b0c4f0516cfc205f