projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
openat-safer: new module
[gnulib.git]
/
lib
/
freadptr.c
diff --git
a/lib/freadptr.c
b/lib/freadptr.c
index
b47e09f
..
3abe58e
100644
(file)
--- a/
lib/freadptr.c
+++ b/
lib/freadptr.c
@@
-1,5
+1,5
@@
/* Retrieve information about a FILE stream.
/* Retrieve information about a FILE stream.
- Copyright (C) 2007-200
8
Free Software Foundation, Inc.
+ Copyright (C) 2007-200
9
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-29,7
+29,7
@@
freadptr (FILE *fp, size_t *sizep)
size_t size;
/* Keep this code in sync with freadahead! */
size_t size;
/* Keep this code in sync with freadahead! */
-#if defined _IO_f
error_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS
, Linux libc5 */
+#if defined _IO_f
trylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku
, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return NULL;
size = fp->_IO_read_end - fp->_IO_read_ptr;
if (fp->_IO_write_ptr > fp->_IO_write_base)
return NULL;
size = fp->_IO_read_end - fp->_IO_read_ptr;
@@
-85,6
+85,14
@@
freadptr (FILE *fp, size_t *sizep)
return NULL;
*sizep = size;
return (const char *) fp->_Next;
return NULL;
*sizep = size;
return (const char *) fp->_Next;
+#elif defined __MINT__ /* Atari FreeMiNT */
+ if (!fp->__mode.__read)
+ return NULL;
+ size = fp->__get_limit - fp->__bufp;
+ if (size == 0)
+ return NULL;
+ *sizep = size;
+ return fp->__bufp;
#elif defined SLOW_BUT_NO_HACKS /* users can define this */
/* This implementation is correct on any ANSI C platform. It is just
awfully slow. */
#elif defined SLOW_BUT_NO_HACKS /* users can define this */
/* This implementation is correct on any ANSI C platform. It is just
awfully slow. */