aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2014-11-20 07:32:15 -0600
committerBrent Cook <bcook@openbsd.org>2014-12-03 17:07:17 -0600
commite83c30c158d8ece1e4b0f459faccfd5e5ae67112 (patch)
tree663dc024cbc2ce527614f1d38715730bef734fbc /tests
parentcccdd689e39b51af02b156229e5236a2a69dcdcb (diff)
downloadportable-e83c30c158d8ece1e4b0f459faccfd5e5ae67112.tar.gz
portable-e83c30c158d8ece1e4b0f459faccfd5e5ae67112.tar.bz2
portable-e83c30c158d8ece1e4b0f459faccfd5e5ae67112.zip
monkey patch more POSIX-like behavior out of winsock 2
Windows sockets functions look on the outside like they behave similarly to POSIX functions, but there are many subtle and glaring differences, including errors reported via WSAGetLastError, read, write, and close do not work on sockets, setsockopt takes a (char *) rather than (void *), etc. This header implements wrappers that coerce more POSIX-like behavior from these functions, making portable code easier to develop. BENEFITS: One does not necessarily need to sprinkle #ifdefs around code to handle the Windows and non-Windows behavior when porting code. CAVEATS: There may be performance implications with the 'mother-may-I' approach to determining if a descriptor is a socket or a file. The errno mappings are not 100% what one might expect compared to POSIX since there were not always good 1:1 equivalents from the WSA errors.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions