summaryrefslogtreecommitdiffstats
path: root/Source/CTest/Curl/CMake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-07 21:32:49 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-07 21:32:49 (GMT)
commite46b0a9290808c5680cf817e96064bd2a0000556 (patch)
treed5d9ed3ba342e0fafdf78809f1bb3f7c6d4f9bdb /Source/CTest/Curl/CMake
parent387ffe941959ab8fa849e5afbe654b15fa9447fe (diff)
downloadCMake-e46b0a9290808c5680cf817e96064bd2a0000556.zip
CMake-e46b0a9290808c5680cf817e96064bd2a0000556.tar.gz
CMake-e46b0a9290808c5680cf817e96064bd2a0000556.tar.bz2
ENH: Properly detect strerror_r for glibc or posix"
Diffstat (limited to 'Source/CTest/Curl/CMake')
-rw-r--r--Source/CTest/Curl/CMake/CurlTests.c45
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