Re: OT: Is "fileno()" conform to ANSI or POSIX?

From: Scott Gifford (sgifford@tir.com)
Date: Tue Mar 06 2001 - 01:53:53 PST

  • Next message: Frederik Ramm: "SANE_INFO_RELOAD_PARAMS on get?"

    Oliver Rauch <oliver.rauch@rauch-domain.de> writes:

    > "Collins, Martin" wrote:
    > >
    > > Oliver Rauch asked:
    > > > The question is if I can expect that fileno() is available
    > > > on most/all systems xsane does compile on.
    > >
    > > I believe fileno() is specified in POSIX 1003.1 and is available
    > > on HP-UX, AIX and QNX as well as in glibc. So you're probably safe
    > > using it.
    >
    > Fine, thanks.
    >
    > By the way, does anyone know if mmap does anything else than
    > buffer=malloc(size) + fread(buffer, size, 1, file) ?
    >
    > This way I would not depend on mmap and fileno.

    Conceptually it does basically this, but it is much much faster,
    requires less real memory, is much much faster, automatically writes
    changes to the mmap()'d region when memory is changed, is much much
    faster, and is much much faster. :-)

    I think any UNIX system recent enough to support mmap() will also
    support fileno().

    -----ScottG.

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Tue Mar 06 2001 - 01:37:43 PST