diff options
Diffstat (limited to 'Source/CTest/Curl/CMake/CurlTests.c')
-rw-r--r-- | Source/CTest/Curl/CMake/CurlTests.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/CTest/Curl/CMake/CurlTests.c b/Source/CTest/Curl/CMake/CurlTests.c index fba8dc4..fed3894 100644 --- a/Source/CTest/Curl/CMake/CurlTests.c +++ b/Source/CTest/Curl/CMake/CurlTests.c @@ -476,3 +476,48 @@ main () return 0; } #endif +#ifdef HAVE_SO_NONBLOCK + +/* headers for SO_NONBLOCK test (BeOS) */ +#include <sys/types.h> +#include <unistd.h> +#include <fcntl.h> + +int main() +{ +/* SO_NONBLOCK source code */ + long b = 1; + int socket; + int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); + return 0; +} +#endif +#ifdef HAVE_GLIBC_STRERROR_R +#include <string.h> +#include <errno.h> +int +main () { + char buffer[1024]; /* big enough to play with */ + char *string = + strerror_r(EACCES, buffer, sizeof(buffer)); + /* this should've returned a string */ + if(!string || !string[0]) + return 99; + return 0; +} +#endif +#ifdef HAVE_POSIX_STRERROR_R +#include <string.h> +#include <errno.h> +int +main () { + char buffer[1024]; /* big enough to play with */ + int error = + strerror_r(EACCES, buffer, sizeof(buffer)); + /* This should've returned zero, and written an error string in the + buffer.*/ + if(!buffer[0] || error) + return 99; + return 0; +} +#endif |