X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Flseek.m4;fp=m4%2Flseek.m4;h=075c2f42c2108415cb87a073a313e5178123f044;hb=e461ff7387db733080824cb94b239d8d1d09c4f3;hp=0000000000000000000000000000000000000000;hpb=e55d665f2854709002b24e51bb5b2ebbd2941e00;p=gnulib.git diff --git a/m4/lseek.m4 b/m4/lseek.m4 new file mode 100644 index 000000000..075c2f42c --- /dev/null +++ b/m4/lseek.m4 @@ -0,0 +1,30 @@ +# lseek.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_LSEEK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], +[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw mistakenly returns 0 when trying to seek on pipes. */ + Choke me. +#endif])], + [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])]) + if test $gl_cv_func_lseek_pipe = no; then + gl_REPLACE_LSEEK + fi +]) + +AC_DEFUN([gl_REPLACE_LSEEK], +[ + AC_LIBOBJ([lseek]) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + REPLACE_LSEEK=1 + AC_DEFINE([LSEEK_PIPE_BROKEN], [1], + [Define to 1 if lseek does not detect pipes.]) +])