diff options
author | Richard Yao <[email protected]> | 2012-06-06 16:51:53 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-06-13 16:18:51 -0700 |
commit | e0093fea58f2ce2764b0b43337c960ed4a5d1b73 (patch) | |
tree | b2313721f9c49493b0109b7767de06c9e18a00b0 /config/spl-build.m4 | |
parent | eaac9ba5102797e0a7e5a1eedb43d792a44770c8 (diff) |
Linux 3.4 compat, __clear_close_on_exec replaces FD_CLR
torvalds/linux@1dce27c5aa6770e9d195f2bb7db1db3d4dde5591 introduced
__clear_close_on_exec() as a replacement for FD_CLR. Further commits
appear to have removed FD_CLR from the Linux source tree. This
causes the following failure:
error: implicit declaration of function '__FD_CLR'
[-Werror=implicit-function-declaration]
To correct this we update the code to use the current
__clear_close_on_exec() interface for readability. Then we introduce
an autotools check to determine if __clear_close_on_exec() is available.
If it isn't then we define some compatibility logic which used the older
FD_CLR() interface.
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #124
Diffstat (limited to 'config/spl-build.m4')
-rw-r--r-- | config/spl-build.m4 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 6605b826d..4d02a72ec 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -44,6 +44,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_INIT_UTSNAME SPL_AC_FDTABLE_HEADER SPL_AC_FILES_FDTABLE + SPL_AC_CLEAR_CLOSE_ON_EXEC SPL_AC_UACCESS_HEADER SPL_AC_KMALLOC_NODE SPL_AC_MONOTONIC_CLOCK @@ -1177,6 +1178,28 @@ AC_DEFUN([SPL_AC_FILES_FDTABLE], [ ]) dnl # +dnl # 3.4.0 API change, +dnl # check whether '__clear_close_on_exec()' exists +dnl # +AC_DEFUN([SPL_AC_CLEAR_CLOSE_ON_EXEC], [ + AC_MSG_CHECKING([whether __clear_close_on_exec() is available]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/fdtable.h> + ],[ + struct fdtable *fdt = NULL; + int fd = 0; + + __clear_close_on_exec(fd, fdt); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CLEAR_CLOSE_ON_EXEC, 1, + [__clear_close_on_exec() is available]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # dnl # 2.6.18 API change, dnl # added linux/uaccess.h dnl # |