# include "syscall-alternative.h"
#endif
+#if defined(ENSC_SYSCALL_TRADITIONAL) && defined(__dietlibc__) && !defined(ENSC_DIETLIBC_HAS_SYSCALL)
+extern long int syscall(long int __sysno, ...);
+#endif
+
#endif // H_UTIL_VSERVER_LIB_SYSCALL_WRAP_H
inline static UNUSED ALWAYSINLINE
int vserver(uint32_t cmd, uint32_t id, void *data)
{
-#if defined __dietlibc__
- extern long int syscall (long int __sysno, ...);
-#endif
-
return syscall(__NR_vserver, cmd, id, data);
}
#else
#ifdef __sparc__
int parent = getpid();
#endif
-#if defined(__dietlibc__) && defined(ENSC_SYSCALL_TRADITIONAL)
- extern long int syscall (long int __sysno, ...);
-#endif
#if defined(__s390__) && defined(ENSC_SYSCALL_TRADITIONAL)
ret = syscall(__NR__sys_clone, child_stack, flags);
inline static UNUSED ALWAYSINLINE
int sys_personality(int pers)
{
-#if defined __dietlibc__
- extern long int syscall (long int __sysno, ...);
-#endif
-
return syscall(__NR_sys_personality, pers);
}
#else
fi
])
+AC_DEFUN([_ENSC_DIETLIBC_SYSCALL],
+[
+ AH_TEMPLATE([ENSC_DIETLIBC_HAS_SYSCALL], [Define to 1 if dietlibc declares syscall])
+
+ AC_CACHE_CHECK([whether dietlibc declares syscall], [ensc_cv_c_dietlibc_syscall],
+ [
+ _ensc_dietlibc_syscall_old_CC="$CC"
+ CC="${DIET:-diet} $CC"
+
+ AC_LANG_PUSH(C)
+ AC_COMPILE_IFELSE([
+ #include <sys/syscall.h>
+ long int syscall(long int __sysno, ...);
+ ],
+ [ensc_cv_c_dietlibc_syscall=no],
+ [ensc_cv_c_dietlibc_syscall=yes])
+ AC_LANG_POP
+
+ CC="$_ensc_dietlibc_syscall_old_CC"
+ ])
+
+ if test x"$ensc_cv_c_dietlibc_syscall" = xyes; then
+ AC_DEFINE(ENSC_DIETLIBC_HAS_SYSCALL,1)
+ fi
+])
+
dnl Usage: ENSC_ENABLE_DIETLIBC(<conditional>[,<min-version>])
dnl <conditional> ... automake-conditional which will be set when
dnl dietlibc shall be enabled
if test x"$ensc_have_dietlibc" != xno; then
_ENSC_DIETLIBC_C99
+ _ENSC_DIETLIBC_SYSCALL
fi
])