lib/fflush.c


Log

Author Commit Date CI Message
John Malmberg cb634d40 2017-07-03T08:05:19 stdioext: Port to OpenVMS. * lib/stdio-impl.h: OpenVMS uses struct _iobuf for FILE information. * lib/fpending.c (fpending): Remove non-working VMS specific code. * lib/fbufmode.c (fbufmode): Fix _IOLBF test to use fp_ macro. * lib/fflush.c (clear_ungetc_buffer): Add OpenVMS to comments. * lib/fpurge.c (fpurge): Likewise. * lib/freadable.c (freadable): Likewise. * lib/freadahead.c (freadahead): Likewise. * lib/freading.c (freading): Likewise. * lib/freadptr.c (freadptr): Likewise. * lib/freadseek.c (freadseek): Likewise. * lib/fseeko.c (fseeko): Likewise. * lib/fseterr.c (fseterr): Likewise. * lib/fwritable.c (fwriteable): Likewise. * lib/fwriting.c (fwriting): Likewise.
Bruno Haible dc42aace 2017-01-07T14:49:10 stdioext: Port to Minix 3.2 and newer. * lib/stdio-impl.h: Treat __minix like the newest NetBSD. * lib/fseeko.c (fseeko): Likewise. Reported by Nelson Beebe via Paul Eggert.
Paul Eggert a3fd683d 2017-01-01T02:59:23 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Bruno Haible 5506db6b 2016-12-13T01:44:06 stdioext: Port to native Windows with MSVC. * lib/stdio-impl.h (WINDOWS_OPAQUE_FILE): New macro. (struct _gl_real_FILE): New type. (fp_, _IOREAD, _IOWRT, _IORW, _IOEOF, _IOERR): New macros, for native Windows. * lib/fbufmode.c (fbufmode): Add code for native Windows. * lib/fflush.c (clear_ungetc_buffer): Treat native Windows like the other SystemV derived implementations. * lib/fpurge.c (fpurge): Likewise. * lib/freadable.c (freadable): Likewise. * lib/freadahead.c (freadahead): Likewise. * lib/freading.c (freading): Likewise. * lib/freadptr.c (freadptr): Likewise. * lib/freadseek.c (freadptrinc): Likewise. * lib/fseeko.c (fseeko): Likewise. * lib/fseterr.c (fseterr): Likewise. * lib/fwritable.c (fwritable): Likewise. * lib/fwriting.c (fwriting): Likewise. Reported by Gisle Vanem <gvanem@yahoo.no>.
Paul Eggert 71090a2a 2016-01-01T00:56:19 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Kevin Cernekee 8e19825e 2015-02-11T15:22:49 Fix FILE struct compatibility with Android API level >= 21 * lib/stdio-impl.h: Test explicitly for __ANDROID__ instead of __sferror. Recent versions of Bionic's stdio.h no longer define __sferror. * lib/fbufmode.c: Likewise. * lib/fflush.c: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise.
Paul Eggert b9bfe784 2015-01-01T01:38:23 version-etc: new year * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
Eric Blake 1276a2c5 2014-01-01T00:04:40 maint: update copyright I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 9fc81090 2013-01-01T00:50:58 maint: update all copyright year number ranges Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert e1656148 2012-11-20T22:25:09 fflush, stat: no 'static inline' * lib/fflush.c (clear_ungetc_buffer_preserving_position) (clear_ungetc_buffer, disable_seek_optimization) (restore_seek_optimization, update_fpos_cache): * lib/stat.c (orig_stat): Now static, not static inline. * lib/fflush.c (disable_seek_optimization, restore_seek_optimization) (update_fpos_cache): Define only if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1). * m4/fflush.m4 (gl_PREREQ_FFLUSH): * m4/stat.m4 (gl_PREREQ_STAT): Do not require AC_C_INLINE.
Bruno Haible 06b335ad 2012-06-22T13:26:07 Write "Mac OS X" instead of "MacOS X". * README: Write "Mac OS X" instead of "MacOS X". * build-aux/bootstrap: Likewise. * build-aux/install-reloc: Likewise. * lib/acl-internal.h: Likewise. * lib/acl_entries.c: Likewise. * lib/argp-ba.c: Likewise. * lib/argp-pv.c: Likewise. * lib/config.charset: Likewise. * lib/copy-acl.c: Likewise. * lib/csharpexec.c: Likewise. * lib/euidaccess.c: Likewise. * lib/fbufmode.c: Likewise. * lib/fflush.c: Likewise. * lib/file-has-acl.c: Likewise. * lib/filemode.h: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fsusage.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. * lib/get-rusage-as.c: Likewise. * lib/get-rusage-data.c: Likewise. * lib/getdomainname.c: Likewise. * lib/idpriv-drop.c: Likewise. * lib/idpriv-droptemp.c: Likewise. * lib/localcharset.c: Likewise. * lib/locale.in.h: Likewise. * lib/localename.c: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/nproc.c: Likewise. * lib/passfd.c: Likewise. * lib/posix_openpt.c: Likewise. * lib/printf-parse.c: Likewise. * lib/progreloc.c: Likewise. * lib/safe-read.h: Likewise. * lib/safe-write.h: Likewise. * lib/sched.in.h: Likewise. * lib/set-mode-acl.c: Likewise. * lib/signal.in.h: Likewise. * lib/stdint.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/strtod.c: Likewise. * lib/sys_select.in.h: Likewise. * lib/tcgetsid.c: Likewise. * lib/unistd.in.h: Likewise. * lib/unlockpt.c: Likewise. * lib/vasnprintf.c: Likewise. * lib/vma-iter.c: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/acl.m4: Likewise. * m4/acosl.m4: Likewise. * m4/asinl.m4: Likewise. * m4/atanl.m4: Likewise. * m4/c-stack.m4: Likewise. * m4/cosl.m4: Likewise. * m4/expl.m4: Likewise. * m4/extensions.m4: Likewise. * m4/fdatasync.m4: Likewise. * m4/fmal.m4: Likewise. * m4/frexp.m4: Likewise. * m4/frexpf.m4: Likewise. * m4/frexpl.m4: Likewise. * m4/fsusage.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/getloadavg.m4: Likewise. * m4/getopt.m4: Likewise. * m4/gettext.m4: Likewise. * m4/gnulib-common.m4: Likewise. * m4/intdiv0.m4: Likewise. * m4/intlmacosx.m4: Likewise. * m4/largefile.m4: Likewise. * m4/ldexpl.m4: Likewise. * m4/link-follow.m4: Likewise. * m4/locale-ar.m4: Likewise. * m4/locale-fr.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale-tr.m4: Likewise. * m4/locale-zh.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/lock.m4: Likewise. * m4/logl.m4: Likewise. * m4/mathfunc.m4: Likewise. * m4/minus-zero.m4: Likewise. * m4/mktime.m4: Likewise. * m4/mmap-anon.m4: Likewise. * m4/multiarch.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/nocrash.m4: Likewise. * m4/poll.m4: Likewise. * m4/printf-frexpl.m4: Likewise. * m4/printf.m4: Likewise. * m4/signbit.m4: Likewise. * m4/sinl.m4: Likewise. * m4/sqrtl.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/tanl.m4: Likewise. * m4/threadlib.m4: Likewise. * m4/ttyname_r.m4: Likewise. * m4/unlink.m4: Likewise. * m4/visibility.m4: Likewise. * m4/wcwidth.m4: Likewise. * tests/minus-zero.h: Likewise. * tests/test-alloca-opt.c: Likewise. * tests/test-copy-acl.sh: Likewise. * tests/test-copy-file.sh: Likewise. * tests/test-fdatasync.c: Likewise. * tests/test-file-has-acl.sh: Likewise. * tests/test-flock.c: Likewise. * tests/test-fsync.c: Likewise. * tests/test-localename.c: Likewise. * tests/test-malloca.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-openpty.c: Likewise. * tests/test-posix_openpt.c: Likewise. * tests/test-ptsname.c: Likewise. * tests/test-ptsname_r.c: Likewise. * tests/test-sameacls.c: Likewise. * tests/test-select.h: Likewise. * tests/test-set-mode-acl.sh: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-strtod.c: Likewise. * tests/test-time.c: Likewise. * tests/test-vasnprintf-posix.c: Likewise. * tests/test-vasprintf-posix.c: Likewise. * doc/acl-resources.txt: Likewise. * doc/**/*.texi: Likewise. Reported by Max Horn <max@quendi.de>.
Simon Josefsson 0e0635af 2012-03-31T09:56:55 fflush: Fix syntax error. * lib/fflush.c: Include unused-parameter.h, needed for _GL_UNUSED_PARAMETER. * modules/fflush (Depends-on): Add snippet/unused-parameter.
Eric Blake dee31b61 2012-03-29T16:57:55 fflush: avoid compiler warning Compiling under glibc produced warnings. * lib/fflush.c (update_fpos_cache): Mark variables that are potentially unused. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Bruno Haible d4d84c1d 2011-07-31T21:16:15 stdioext: Add support for Minix. * lib/fbufmode.c (fbufmode) [__minix]: Add conditional code. * lib/fpurge.c (fpurge): Likewise. * lib/freadahead.c (freadahead): Likewise. * lib/freadable.c (freadable): Likewise. * lib/freading.c (freading): Likewise. * lib/freadptr.c (freadptr): Likewise. * lib/freadseek.c (freadptrinc): Likewise. * lib/fseeko.c (rpl_fseeko): Likewise. * lib/fseterr.c (fseterr): Likewise. * lib/fwritable.c (fwritable): Likewise. * lib/fwriting.c (fwriting): Likewise. * lib/fflush.c (clear_ungetc_buffer): Update comment. * m4/fpending.m4 (gl_PREREQ_FPENDING): Add a variant for Minix.
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Bruno Haible 1a56c64d 2010-12-22T17:37:34 Port extended stdio modules to HP NonStop Kernel. * lib/stdio-impl.h (_IOERR, _IOREAD, _IOWRT, _IORW) [__TANDEM]: New macros. * lib/fbufmode.c: Update comments. * lib/fflush.c: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. Reported by Joachim Schmitz <jojo@schmitz-digital.de>.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Bruno Haible 4e95eaff 2009-12-19T12:30:24 fflush: tweak
Eric Blake 4215bcc7 2009-12-14T15:42:13 fflush: avoid compilation error on NetBSD On NetBSD, the system <stdio.h> header contains: |#if (!defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)) || defined(_LIBC) |typedef __off_t fpos_t; |#else |typedef struct __sfpos { | __off_t _pos; |} fpos_t; |#endif Thus, based on compiler flags (such as using 'gcc -ansi' or the Intel compiler), it is an error to directly set fpos_t=off_t. * lib/fflush.c (update_fpos_cache): Use a union to safely convert between off_t and fpos_t, since the latter is sometimes a struct. * lib/fseeko.c (rpl_fseeko): Likewise. Reported by Alexander Nasonov <alnsn@yandex.ru>. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 7becd9d7 2009-11-07T16:03:38 fflush, freadseek: use fseeko, not fseek Follow our own advice: fseek is not safe to use on large files. * lib/fflush.c (clear_ungetc_buffer_preserving_position) (clear_ungetc_buffer): Avoid potential problems on large files. * lib/freadseek.c (freadseek): Likewise. * modules/freadseek (Depends-on): Add fseeko. * modules/fseek (configure.ac): Set a witness. * tests/test-fflush.c (main): Use fseeko. * tests/test-fpurge.c (fseek): Disable link warning. * tests/test-freadable.c (fseek): Likewise. * tests/test-freading.c (fseek): Likewise. * tests/test-fseeko.c (fseek): Likewise. * tests/test-ftell.c (fseek): Likewise. * tests/test-ftello.c (fseek): Likewise. * tests/test-fwritable.c (fseek): Likewise. * tests/test-fwriting.c (fseek): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 0d626a9b 2009-06-24T06:49:00 fpurge: migrate into <stdio.h> * lib/fpurge.h: Delete... * lib/stdio.in.h (fpurge): ...and declare here, instead. * lib/fpurge.c (fpurge): Change declaring header. * modules/fpurge (Files): Drop deleted file. (Depends-on): Add stdio. (configure.ac): Set witness. * modules/stdio (Makefile.am): Support fpurge macros. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/fpurge.m4 (gl_FUNC_FPURGE): Set appropriate variables. * lib/fflush.c: Update client. * tests/test-fpurge.c: Likewise. * NEWS: Mention the change. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 4cbb934b 2009-03-01T02:19:56 Undo last lib/fflush.c commit.
Bruno Haible 81fe603b 2009-02-28T21:24:24 Add tentative support for FreeMiNT.
Jim Meyering 3d8e34bd 2009-01-26T18:32:23 fflush: avoid warnings on modern systems * lib/fflush.c (rpl_fflush): Move declarations of locals, pos and result, into scopes where they're used.
Bruno Haible 557a006f 2009-01-16T02:07:53 Make fflush-after-ungetc POSIX compliant on BSD systems.
Bruno Haible 1074f459 2009-01-16T00:24:35 Make fflush-after-ungetc POSIX compliant on glibc systems.
Bruno Haible 6226b4cf 2008-04-26T19:42:00 Oops, fix mistake in third-to-last commit.
Bruno Haible 284866a4 2008-04-26T18:58:00 Add tentative support for DragonFly BSD.
Bruno Haible 569eba62 2008-04-26T18:12:05 New private include file lib/stdio-impl.h.
Bruno Haible 02a3c767 2008-04-26T16:42:17 Put system dependent routines into inline functions.
Bruno Haible 4a11bb6c 2008-03-09T22:12:35 Fix comments in last commit.
Bruno Haible 679b14d8 2008-03-07T03:34:46 Make fflush after ungetc work on BSD platforms.
Bruno Haible 57fdfd3f 2007-10-07T19:14:58 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible 27de795d 2007-09-30T01:06:17 Remove execute permission.
Bruno Haible 9faed5de 2007-07-31T22:15:00 Use a slightly cleaner hack on BSD systems.
Eric Blake e13c2b4a 2007-04-27T18:05:08 * lib/freading.h: Improve comments. * lib/fwriting.h: Likewise. * lib/fflush.c: Likewise.
Bruno Haible 8a076be4 2007-04-27T10:56:51 More comments.
Eric Blake 9b87488b 2007-04-26T13:20:50 Fix fflush on mingw. * modules/fflush (Depends-on): Add freading. * lib/fflush.c (rpl_fflush): Use freading to avoid losing buffered but unread data.
Bruno Haible 0a786d25 2007-04-26T09:25:05 On BSD implementations, when we call lseek(), we must also update or disable the stream's file descriptor position cache.
Eric Blake d1e3faec 2007-04-23T12:49:50 * lib/fflush.c: Fix missing include. Reported by Bruno Haible.
Eric Blake e7f31c67 2007-04-17T03:38:08 Make fflush rely on fpurge. * lib/fflush.c (rpl_fflush): Rely on fpurge module, rather than open coding all variants. * modules/fflush (Depends-on): Add fpurge and unistd. * modules/fflush-tests (Depends-on): Unistd is no longer extra. * m4/fflush.m4 (gl_REPLACE_FFLUSH): Simplify.
Eric Blake ace67a47 2007-04-12T11:59:14 No need to preserve errno on success. * lib/fflush.c (rpl_fflush): Simplify errno tracking. Reported by Bruno Haible.
Eric Blake 0c47a3bb 2007-04-10T03:09:07 * lib/stdio_.h [REPLACE_FFLUSH]: Declare rpl_fflush. * modules/stdio (Makefile.am): Support fflush. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * modules/fflush: New file. * lib/fflush.c: Likewise. * m4/fflush.m4: Likewise. * modules/fflush-tests: New test. * tests/test-fflush.c: Likewise. * MODULES.html.sh (Input/output <stdio.h>): Document new module.