Message140923
| Author |
Kuberan.Naganathan |
| Recipients |
Kuberan.Naganathan, jcea, neologix, pitrou, vstinner |
| Date |
2011年07月23日.01:16:31 |
| SpamBayes Score |
3.1641356e-15 |
| Marked as misclassified |
No |
| Message-id |
<CAK=_o0g5vCEQeryEOVa91wJx-rn_2KvxNxLk9BBwizna0TcJdg@mail.gmail.com> |
| In-reply-to |
<CAH_1eM2eh0io5_Bi-1KP2NZn8mfq8ndE=JOinsHBb2fs-yN_RQ@mail.gmail.com> |
| Content |
yes. i noticed problem on solaris on the /proc/<pid>/as file which usually
has mapped regions beyond 2^63 in most process files
On Jul 22, 2011 4:35 PM, "Charles-François Natali" <report@bugs.python.org>
wrote:
>
> Charles-François Natali <neologix@free.fr> added the comment:
>
> Patch attached.
>
>> For lseek, we can rely on errno. Try something like that:
>>
>> errno = 0;
>> offset = lseek(...);
>> if (offset == (off_t)-1 && errno) /* error */
>>
>
> It's a little bit overkill :-) (for mktime, time_t can overflow easily
> on 32-bit).
>
>> We can write a test using a sparse file... Or maybe a mmap object?
>>
>
> I'm not sure it's easily testable, because it's really a corner case
> not addressed by POSIX. On my Linux box, I can't get lseek to return a
> negative value, I get EINVAL - which does make sense (the Linux kernel
> doesn't accept or return negative file offsets, see
> http://lwn.net/Articles/138063/).
>
> Kuberan, on what operating system did you notice this problem? Solaris?
>
> ----------
> keywords: +patch
> Added file: http://bugs.python.org/file22719/lseek_negative.diff
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue12545>
> _______________________________________ |
| Files |
| File name |
Uploaded |
|
unnamed
|
Kuberan.Naganathan,
2011年07月23日.01:16:30
|
|