changeset 10140:879d77289ca0

Use special-purpose function in DragonFly BSD.
author Bruno Haible <bruno@clisp.org>
date Sun, 01 Jun 2008 18:43:55 +0200
parents 0f46743a158e
children 69c854126601
files ChangeLog lib/freadahead.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jun 01 12:10:29 2008 +0200
+++ b/ChangeLog	Sun Jun 01 18:43:55 2008 +0200
@@ -1,3 +1,9 @@
+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.
--- a/lib/freadahead.c	Sun Jun 01 12:10:29 2008 +0200
+++ b/lib/freadahead.c	Sun Jun 01 18:43:55 2008 +0200
@@ -33,8 +33,12 @@
 #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;