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

From: Petter Reinholdtsen (pere@hungry.com)
Date: Mon Mar 05 2001 - 11:04:20 PST

  • Next message: Dario Abatianni: "Snapscan e50 USB Question"

    [Oliver Rauch]
    > 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.

    Eh, yes. mmap() maps the file into the process address space, and
    allow you to access the file content without copying it from the
    kernel buffers into your own buffers. (ie the kernel buffers become
    part of the process address space.)

    It is a lot faster than malloc() and fread().

    -- 
    ##>  Petter Reinholdtsen <##    | pere@td.org.uit.no
     O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
    http://www.hungry.com/~pere/    | Go Mozilla, go! Go!
    

    -- 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 : Mon Mar 05 2001 - 10:46:39 PST