cmake: Add check for syscall prototype.
authorAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Nov 2013 08:41:41 +0000 (09:41 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Nov 2013 08:41:41 +0000 (09:41 +0100)
ConfigureChecks.cmake
config.h.cmake
src/uid_wrapper.c

index f85a125cde085b3f257ca423a9891c2bc683ecef..bfd1919dbc9c03add39f4b0c95dc15f9930f98f1 100644 (file)
@@ -81,6 +81,12 @@ check_function_exists(syscall HAVE_SYSCALL)
 
 if (HAVE_SYSCALL)
     add_definitions(-D_GNU_SOURCE)
+
+    check_prototype_definition(syscall
+        "int syscall(int sysno, ...)"
+        "-1"
+        "unistd.h;sys/syscall.h"
+        HAVE_SYSCALL_INT)
 endif (HAVE_SYSCALL)
 
 # OPTIONS
index f9a3c72674153d015d95c1d7c295ec18ae1b2266..f5dddaf619c0aae13bb66d83d052cff495176007 100644 (file)
@@ -46,6 +46,7 @@
 
 /* Define to 1 if you have the `syscall' function. */
 #cmakedefine HAVE_SYSCALL 1
+#cmakedefine HAVE_SYSCALL_INT 1
 
 /*************************** LIBRARIES ***************************/
 
index 8a1651362d53ffc1e72a03db3f57cf20b8758fa7..9c88c34da1adb1e621c13c8e0e111d9dc6a5087a 100644 (file)
@@ -962,9 +962,17 @@ static long int uwrap_syscall (long int sysno, va_list vp)
 }
 
 #ifdef HAVE_SYSCALL
+#ifdef HAVE_SYSCALL_INT
+int syscall (int sysno, ...)
+#else
 long int syscall (long int sysno, ...)
+#endif
 {
+#ifdef HAVE_SYSCALL_INT
+       int rc;
+#else
        long int rc;
+#endif
        va_list va;
 
        va_start(va, sysno);