STABLE14-linux-5-arg-sock-create-20040825

update for sock_create 5 arg with a better configure test


(cherry picked from commit cb1b41b159b98881f66319d7f65d941ba9fab911)
This commit is contained in:
Sven Menke 2004-08-25 21:40:13 +00:00 committed by Derrick Brashear
parent 4c470b3620
commit d44a71e70d
3 changed files with 21 additions and 1 deletions

View File

@ -185,6 +185,7 @@ case $system in
LINUX_INODE_SETATTR_RETURN_TYPE
LINUX_KERNEL_LINUX_SYSCALL_H
LINUX_KERNEL_SELINUX
LINUX_KERNEL_SOCK_CREATE
LINUX_NEED_RHCONFIG
LINUX_RECALC_SIGPENDING_ARG_TYPE
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
@ -296,6 +297,9 @@ case $system in
if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
fi
if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
fi
if test "x$ac_linux_syscall" = "xyes" ; then
AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
fi

View File

@ -94,3 +94,19 @@ AC_TRY_COMPILE(
ac_cv_linux_kernel_is_selinux=no)])
AC_MSG_RESULT($ac_cv_linux_kernel_is_selinux)
CPPFLAGS="$save_CPPFLAGS"])
AC_DEFUN([LINUX_KERNEL_SOCK_CREATE],[
AC_MSG_CHECKING(for 5th argument in sock_create found in some SELinux kernels)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
AC_CACHE_VAL(ac_cv_linux_kernel_sock_create_v,
[
AC_TRY_COMPILE(
[#include <linux/net.h>],
[
sock_create(0,0,0,0,0)
],
ac_cv_linux_kernel_sock_create_v=yes,
ac_cv_linux_kernel_sock_create_v=no)])
AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)

View File

@ -40,7 +40,7 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
/* We need a better test for this. if you need it back, tell us
* how to detect it.
*/
#if 0/*def LINUX_KERNEL_IS_SELINUX*/
#ifdef LINUX_KERNEL_SOCK_CREATE_V
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp, 0);
#else
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp);