Commit 1625813e authored by Niels Möller's avatar Niels Möller

New check for filio.h.

(HAVE_IOCTL_FIONREAD): New check, if ioctl FIONREAD exists, and
takes an int argument.

Rev: ChangeLog:1.904
Rev: configure.ac:1.69
parent afdb8faf
2006-05-23 Niels Mller <niels@s3.kth.se>
* configure.ac: New check for filio.h.
(HAVE_IOCTL_FIONREAD): New check, if ioctl FIONREAD exists, and
takes an int argument.
2006-05-19 Niels Mller <nisse@lysator.liu.se>
* src/jpoll.c, src/jpoll.h: Deleted files.
......
......@@ -260,6 +260,7 @@ AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(argp.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/filio.h)
AC_CHECK_HEADERS(utmp.h, [have_utmp_h=yes], [have_utmp_h=no])
AC_CHECK_HEADERS(utmpx.h, [have_utmpx_h=yes], [have_utmpx_h=no])
......@@ -738,6 +739,59 @@ else
AC_MSG_WARN([No support for UNIX98 PTYs. PTY support disabled.])
fi
# Check that FIONREAD exists, works, and uses an argument of type int, not long.
AC_CACHE_CHECK(
[for FIONREAD with int argument],
lsh_cv_sys_ioctl_fionread_int,
[AC_TRY_RUN([
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#if HAVE_SYS_FILIO_H
#include <sys/filio.h>
#endif
int main(int argc, char **argv)
{
#ifdef FIONREAD
union {
int i[2];
long l;
} val;
int fds[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0)
{
printf("socketpair failed: errno = %d.\n", errno);
return 1;
}
val.i[0] = 0xdeadbeaf;
val.i[1] = 0xdeadbeaf;
if (ioctl(fds[0], FIONREAD, val.i) < 0)
{
printf("ioctl FIONREAD failed: errno = %d.\n", errno);
return 1;
}
if (val.i[0] == 0 && val.i[1] == 0xdeadbeaf)
return 0;
#endif
return 1;
}
], lsh_cv_sys_ioctl_fionread_int=yes,
lsh_cv_sys_ioctl_fionread_int=no,
lsh_cv_sys_ioctl_fionread_int=no)])
AH_TEMPLATE([HAVE_IOCTL_FIONREAD],
[Define if the FIONREAD ioctl works, and uses an argument of type int])
if test x$lsh_cv_sys_ioctl_fionread_int = xyes; then
AC_DEFINE([HAVE_IOCTL_FIONREAD])
fi
LSH_GCC_ATTRIBUTES
AC_MSG_CHECKING(for BSD pty names)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment