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

From: Oliver Rauch (oliver.rauch@rauch-domain.de)
Date: Mon Mar 05 2001 - 11:16:26 PST

  • Next message: Frederik Ramm: "sane_get_parameters before sane_start"

    Petter Reinholdtsen wrote:
    >
    > [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().

    Hi Petter,

    but if I understand that right this is releavant only
    for the mmap call, so if I call malloc and fread
    this is a bit slower than calling mmap, but accessing
    the buffer memory should not make any speed differences?!

    Bye
    Oliver

    -- 
    Homepage:	http://www.rauch-domain.de
    sane-umax:	http://www.rauch-domain.de/sane-umax
    xsane:		http://www.xsane.org
    E-Mail:		mailto:Oliver.Rauch@rauch-domain.de
    

    -- 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:56:43 PST