lkml.org 
[lkml]   [2000]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap_file common case?
Jeff Garzik writes:
> When dealing with files it is common to mmap all of a file, or up to XXX
> bytes of a file. Is there any way to reduce the number of syscalls for
> this operation from 3 to 1?
>
> fd = open(...);
> stat(...); /* get size for mmap */
> addr = mmap(...);

Why do you want to reduce the number of syscalls? To improve speed?
You might find that the time is dominated by the mmap(2) call, which
has to set up page tables.

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:1.055 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site