Skip Menu |

This queue is for tickets about the Sys-PageCache CPAN distribution.

Report information
The Basics
Id: 128340
Status: open
Priority: 0/
Queue: Sys-PageCache

People
Owner: Nobody in particular
Requestors: user42_kevin [...] yahoo.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: suggest no file length check
Date: Thu, 24 Jan 2019 11:59:41 +1100
To: bug-Sys-PageCache [...] rt.cpan.org
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
I see fadvise() checks the length of the file and warns if the advised region exceeds the length. As a suggestion, I think that could be omitted. I think the system call allows regions beyond the end of a file and quietly ignores the excess. If a file size is changing, or if you're just advising about say the next 10 kbytes from current file position which you're going to read, then it'd be convenient not to worry about possibly being past the end.
On 2019-1月-23 水 20:06:13, user42_kevin@yahoo.com.au wrote: Show quoted text
> I think the system call allows regions beyond the end of a file and > quietly ignores the excess. If a file size is changing, or if you're
Is this documented behavior? I cannot find in this document: http://man7.org/linux/man-pages/man2/posix_fadvise.2.html I think it is not good relying on undocumented behavior.
Subject: Re: [rt.cpan.org #128340] suggest no file length check
Date: Sat, 26 Jan 2019 09:50:10 +1100
To: "HIROSE Masaaki via RT" <bug-Sys-PageCache [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"HIROSE Masaaki via RT" <bug-Sys-PageCache@rt.cpan.org> writes: Show quoted text
I think so, where it says The advice applies to a (not necessarily existent) region so the region doesn't have to exist. Show quoted text
> I think it is not good relying on undocumented behavior.
I'd suggest just making the system call(s), since the system will say an errno etc if it doesn't like what you do.
Hi, Could you send a pull request? https://github.com/hirose31/Sys-PageCache/pulls