Use special-purpose function in DragonFly BSD.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2008 16:43:55 +0000 (18:43 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2008 16:43:55 +0000 (18:43 +0200)
ChangeLog
lib/freadahead.c

index 0eefe09..0ce10b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-06-01  Bruno Haible  <bruno@clisp.org>
 
+       * lib/freadahead.c (freadahead) [__DragonFly__]: Use the __sreadahead
+       function.
+       Reported by VOROSKOI Andras <voroskoi@gmail.com>.
+
+2008-06-01  Bruno Haible  <bruno@clisp.org>
+
        * modules/rpmatch (Depends-on): Add strdup.
 
 2008-06-01  Bruno Haible  <bruno@clisp.org>
index 610de87..15cc708 100644 (file)
@@ -33,8 +33,12 @@ freadahead (FILE *fp)
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
   if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0)
     return 0;
+# if defined __DragonFly__
+  return __sreadahead (fp);
+# else
   return fp_->_r
         + (HASUB (fp) ? fp_->_ur : 0);
+# endif
 #elif defined __EMX__               /* emx+gcc */
   if ((fp->_flags & _IOWRT) != 0)
     return 0;