Message140904
| Author |
neologix |
| Recipients |
Kuberan.Naganathan, jcea, neologix, pitrou, vstinner |
| Date |
2011年07月22日.20:35:06 |
| SpamBayes Score |
5.3744176e-10 |
| Marked as misclassified |
No |
| Message-id |
<CAH_1eM2eh0io5_Bi-1KP2NZn8mfq8ndE=JOinsHBb2fs-yN_RQ@mail.gmail.com> |
| In-reply-to |
<1311149926.15.0.754151765935.issue12545@psf.upfronthosting.co.za> |
| Content |
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? |
|