summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2007-05-24 16:59:20 +0000
committerEric Blake <ebb9@byu.net>2007-05-24 16:59:20 +0000
commite461ff7387db733080824cb94b239d8d1d09c4f3 (patch)
tree0d62b7ae517125e4b6b1148b129d4b320a12c090 /modules
parente55d665f2854709002b24e51bb5b2ebbd2941e00 (diff)
downloadgnulib-e461ff7387db733080824cb94b239d8d1d09c4f3.tar.gz
Fix lseek on mingw.
* modules/lseek: New module. * m4/lseek.m4: New file. * lib/lseek.c: New file. * modules/lseek-tests: New file. * tests/test-lseek.c: New file. * tests/test-lseek.sh: New file. * MODULES.html.sh: Document lseek module. * modules/fflush (Depends-on): Add lseek, fseeko. * modules/fseeko (Depends-on): Likewise. * modules/ftello (Depends-on): Likewise. * m4/fseeko.m4 (gl_FUNC_FSEEKO): Replace fseek[o] if lseek is broken. * m4/ftello.m4 (gl_FUNC_FTELLO): Replace ftell[o] if lseek is broken. * m4/fflush.m4 (gl_REPLACE_FFLUSH): Trigger fseeko module. * lib/fseeko.c (rpl_fseeko): Quit early on non-seekable files. * lib/ftello.c (rpl_ftello): Likewise. * tests/test-fseeko.c (main): Test this. * tests/test-fseeko.sh: Likewise. * tests/test-ftello.c (main): Likewise. * tests/test-ftello.sh: Likewise. * lib/stdio_.h (fseek, ftell): Simplify, since missing fseeko now implies replacing fseek. * modules/stdio (Makefile.am): No longer need HAVE_FSEEKO, HAVE_FTELLO. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add lseek info. * modules/unistd (Makefile.am): Likewise. * lib/unistd_.h (lseek): Declare a replacement. * doc/functions/lseek.texi (lseek): Document this fix. * doc/functions/fseek.texi (fseek): Likewise. * doc/functions/ftell.texi (ftell): Likewise.
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/fflush4
-rw-r--r--modules/fseeko1
-rw-r--r--modules/ftello1
-rw-r--r--modules/lseek24
-rw-r--r--modules/lseek-tests13
-rw-r--r--modules/stdio2
-rw-r--r--modules/unistd2
7 files changed, 43 insertions, 4 deletions
diff --git a/modules/fflush b/modules/fflush
index 9caf403ab0..ac74dc5104 100755
--- a/modules/fflush
+++ b/modules/fflush
@@ -3,16 +3,16 @@ Discard pending data on both input and output streams.
Files:
lib/fflush.c
-lib/fseeko.c
m4/fflush.m4
-m4/fseeko.m4
Depends-on:
fpurge
ftello
freading
+lseek
stdio
unistd
+fseeko
configure.ac-early:
AC_REQUIRE([AC_FUNC_FSEEKO])
diff --git a/modules/fseeko b/modules/fseeko
index af6eccbd1e..0a845e8e66 100644
--- a/modules/fseeko
+++ b/modules/fseeko
@@ -6,6 +6,7 @@ lib/fseeko.c
m4/fseeko.m4
Depends-on:
+lseek
stdio
configure.ac-early:
diff --git a/modules/ftello b/modules/ftello
index 2d6b724489..d7ea365bba 100644
--- a/modules/ftello
+++ b/modules/ftello
@@ -6,6 +6,7 @@ lib/ftello.c
m4/ftello.m4
Depends-on:
+lseek
stdio
configure.ac-early:
diff --git a/modules/lseek b/modules/lseek
new file mode 100644
index 0000000000..4c541ab128
--- /dev/null
+++ b/modules/lseek
@@ -0,0 +1,24 @@
+Description:
+lseek() function: Reposition a file descriptor.
+
+Files:
+lib/lseek.c
+m4/lseek.m4
+
+Depends-on:
+unistd
+
+configure.ac:
+gl_FUNC_LSEEK
+gl_UNISTD_MODULE_INDICATOR([lseek])
+
+Makefile.am:
+
+Include:
+<unistd.h>
+
+License:
+LGPL
+
+Maintainer:
+Eric Blake
diff --git a/modules/lseek-tests b/modules/lseek-tests
new file mode 100644
index 0000000000..d117bf1f29
--- /dev/null
+++ b/modules/lseek-tests
@@ -0,0 +1,13 @@
+Files:
+tests/test-lseek.c
+tests/test-lseek.sh
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-lseek.sh
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)'
+check_PROGRAMS += test-lseek
+EXTRA_DIST += test-lseek.sh
diff --git a/modules/stdio b/modules/stdio
index dd49435c4e..c8a462373b 100644
--- a/modules/stdio
+++ b/modules/stdio
@@ -46,9 +46,7 @@ stdio.h: stdio_.h
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
- -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
- -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
diff --git a/modules/unistd b/modules/unistd
index afb7a89c2d..6bf946061b 100644
--- a/modules/unistd
+++ b/modules/unistd
@@ -29,6 +29,7 @@ unistd.h: unistd_.h
-e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
-e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
+ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
@@ -39,6 +40,7 @@ unistd.h: unistd_.h
-e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
< $(srcdir)/unistd_.h; \
} > $@-t
mv $@-t $@