2 ioctl() function: issue device specific requests on files, devices, or sockets.
14 AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
15 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
16 if test "$ac_cv_header_winsock2_h" = yes; then
17 dnl Even if the 'socket' module is not used here, another part of the
18 dnl application may use it and pass file descriptors that refer to
19 dnl sockets to the ioctl() function. So enable the support for sockets.
21 gl_REPLACE_SYS_IOCTL_H
23 AC_CHECK_FUNCS([ioctl])
24 dnl On glibc systems, the second parameter is 'unsigned long int request',
25 dnl not 'int request'. We cannot simply cast the function pointer, but
26 dnl instead need a wrapper.
27 AC_CACHE_CHECK([for ioctl with POSIX signature],
28 [gl_cv_func_ioctl_posix_signature],
31 [[#include <sys/ioctl.h>]],
32 [[extern int ioctl (int, int, ...);]])
34 [gl_cv_func_ioctl_posix_signature=yes],
35 [gl_cv_func_ioctl_posix_signature=no])
37 if test $gl_cv_func_ioctl_posix_signature != yes; then
40 gl_REPLACE_SYS_IOCTL_H
43 gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
54 Paolo Bonzini, Simon Josefsson, Bruno Haible