On Fri, Feb 13, 2026 at 5:17 AM Alyssa M via 9fans <[email protected]> wrote:

> I think having the whole file in your address space makes it easier to
> select the bits of the file you want to read - assuming you don't need to
> read all or even most of it.
>
>
Again, what is difficult about doing a seek?
Let's take the simplest possible example, e.g. say you have a 1TB file, and
you need one byte from the middle of the file. How is a seek of 500GB and a
1byte complicated?
are you just missing a syntaxsugar here, cause you dont like to run 2
system calls? what if you used a wrapper function called
seekandread(filename, seekoffset, size); so you'd char x =
seekandread(file, 500G, 1); still a complexity issue?
i don't think mmap will make this any simpler


> My interest is in simpler software - so I'm exploring a way get some of
> the effect of mmap without having actual mmap - by making it an
> implementation detail.
> <https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-Mdbd5febf25c74da357aee4b1>
>

Again, what is the favourable effect of mmap? i'm seeing nothing special
that one should strive for here. I agree with Dan in that if it *was* easy
to map mmap to read, then the two would at best be equivalent, and thus
read would suffice and mmap isn't needed at all.
If on the other hand there was any advantage at all that read() + seek() is
missing out on then why bother mapping it to read() in the first place? why
overload the syscall and make it more complicated?

> Permalink
> <https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-Mdbd5febf25c74da357aee4b1>
>

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-M37ab029f6df3c52ad0979147
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to