extended stdio API on DragonFly

Bruno Haible bruno at clisp.org
Mon Apr 21 18:05:39 PDT 2008

> | One of the main DragonFly developers provided a patch, see
> | http://leaf.dragonflybsd.org/mailarchive/users/2008-04/msg00044.html

Thanks. Matthew Dillon added the __sreadahead function just a few days
ago. It is equivalent to gnulib's freadahead function, except that freadahead
returns 0 if ((fp->_flags & __SWR) != 0 || fp->_r < 0).

It looks like the DragonFly developers are recognizing the need for more
API on FILE streams. The freadahead function is just one among ca. 10
such functions that gnulib wants to support.

You find in   http://www.haible.de/bruno/gnu/testdir-stdioext.tar.gz
the documentation and implementation for all systems so far (from BSD
systems to QNX), and a test suite. The documentation/specification is
in the .h files.

To port this package:

  - Unpack the package, configure it. Try "make" and fix the problems.
  - Run "make check" to see the test results.
  - The recommended order of porting (from easy to harder) is:
    fbufmode, fseterr, freadable, fwritable, freading, fwriting,
    fpending, fpurge, freadptr, freadseek, freadahead.

If you want to have the complete liberty to shuffle around fields in the
FILE struct, without risking crashes of programs that use gnulib, and you
add such primitive functions to DragonFly, gnulib will use these primitives
(provided they pass the testsuite).


More information about the Users mailing list