lib/fflush.c


Log

Author Commit Date CI Message
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.