summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-25 11:47:06 +0200
committerJim Meyering <jim@meyering.net>2006-10-25 11:47:06 +0200
commit95954ad5832e2dcc5709401643e615612281fc88 (patch)
treef2e177344d26d5d4a7b0bd9964f25a7d27d7913d
parente81a82b74f44bfddce247d566617137725f11b19 (diff)
downloadcoreutils-95954ad5832e2dcc5709401643e615612281fc88.tar.xz
Portability to Tru64 V4.0.
* src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]: Define inline replacement function. This (along with a yesterday's fix for autoconf's _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils now builds once more on Tru64 V4.0. Reported by Nelson Beebe.
-rw-r--r--ChangeLog9
-rw-r--r--src/system.h24
2 files changed, 29 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 195ca75ef..2ee39fe7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-25 Jim Meyering <jim@meyering.net>
+
+ Portability to Tru64 V4.0.
+ * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
+ Define inline replacement function.
+ This (along with a yesterday's fix for autoconf's
+ _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
+ now builds once more on Tru64 V4.0. Reported by Nelson Beebe.
+
2006-10-25 Bruno Haible <bruno@clisp.org>
* src/cat.c (infile): Add "const" to declaration.
diff --git a/src/system.h b/src/system.h
index 87a379e22..efe929098 100644
--- a/src/system.h
+++ b/src/system.h
@@ -515,10 +515,26 @@ enum
# define EOVERFLOW EINVAL
#endif
-#if ! HAVE_FSEEKO && ! defined fseeko
-# define fseeko(s, o, w) ((o) == (long int) (o) \
- ? fseek (s, o, w) \
- : (errno = EOVERFLOW, -1))
+#if ! HAVE_FSEEKO
+# if ! defined fseeko
+# define fseeko(s, o, w) ((o) == (long int) (o) \
+ ? fseek (s, o, w) \
+ : (errno = EOVERFLOW, -1))
+# endif
+# if ! defined ftello
+static inline off_t ftello (FILE *stream)
+{
+ off_t off = ftell (stream);
+ if (off < 0)
+ return off;
+ if (off != (long int) off)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ return off;
+}
+# endif
#endif
#if ! HAVE_SYNC