summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2005-12-13 16:44:02 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2005-12-13 16:44:02 (GMT)
commite237d50390433a4d38944221a6c3280cc6940d9e (patch)
tree326e24476a76c251bbcbbd8c3acc18d5f2d07adf /configure.in
parent50f8169fb6520488c6b4dfcb4603e845d5ae1ca1 (diff)
downloadcpython-e237d50390433a4d38944221a6c3280cc6940d9e.zip
cpython-e237d50390433a4d38944221a6c3280cc6940d9e.tar.gz
cpython-e237d50390433a4d38944221a6c3280cc6940d9e.tar.bz2
Add a workaround for file.ftell() to raise IOError for ttys.
ftell(3) on BSD doesn't set errno even for ttys and returns useless values.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 75a33a1..0550e4f 100644
--- a/configure.in
+++ b/configure.in
@@ -2955,6 +2955,28 @@ then
[Define if poll() sets errno on invalid file descriptors.])
fi
+AC_MSG_CHECKING(for broken ftell())
+AC_CACHE_VAL(ac_cv_broken_ftell, [
+AC_TRY_RUN([
+#include <stdio.h>
+int main()
+{
+ long val = ftell(stdin);
+ if (val != -1)
+ exit(0);
+ exit(1);
+}
+],
+ac_cv_broken_ftell=yes,
+ac_cv_broken_ftell=no,
+ac_cv_broken_ftell=no)])
+AC_MSG_RESULT($ac_cv_broken_ftell)
+if test "$ac_cv_broken_ftell" = yes
+then
+ AC_DEFINE(HAVE_BROKEN_FTELL, 1,
+ [Define if ftell() set errno on tty files.])
+fi
+
# Before we can test tzset, we need to check if struct tm has a tm_zone
# (which is not required by ISO C or UNIX spec) and/or if we support
# tzname[]