This adds a getopt implementation for compatibility where it is not
available, removing a couple of regress patches.
Note, this is a slightly modified copy from OpenBSD libc that doesn't
expose getopt_long, which has dependency conflicts with Windows system
headers and isn't needed anyway.
based on discussion in https://github.com/libressl/portable/issues/266
and https://bugs.python.org/issue23524 adjust the compat layer for
Windows to use _get_osfhandle in combination with
_set_thread_local_invalid_parameter_handler if applicable to more
reliably determine if a handle is a socket, file, or closed socket.
This prevents assertions when calling tls_close on an already-closed
socket.
- read() returns bytes count as 1 for crlf unless binary mode isn't
specified with open(). Reported by @ulfworsoe in libressl-portable#542
- err could be WSANOTINITIALISED when WSAStartup() is not called
This diff fixes the build of LibreSSL for Android with API < 21 where
the `getprogname` system call was not part of libc.
A comment in the diff itself explains in detail the issue.
Locks are required for multi-threading. If memory can't be allocated, exit the program with memory error. If we let the program continue, it will deadlock in the next part of the code anyway so better end it before.
VS2013 has trouble with relative include paths for apps/openssl, so move
certhash_win/apps_win.c back to apps/openssl.
gmtime_r on mingw64 fails with negative time_t, override
gmtime_s fails all of the time unit tests, override
SHUT_RD/WR are defined in newer mingw64 headers, check before overriding
This moves the compatibility include files from include to
include/compat so we can use the awful MS C compiler
<../include/> trick to emulate the GNU #include_next extension.
This also removes a few old compat files we do not need anymore.