Bug 7822 – lseek cast(int)offset should be lseek cast(off_t)offset
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2012-04-04T14:18:00Z
Last change time
2014-05-28T06:35:01Z
Assigned to
nobody
Creator
jayn
Comments
Comment #0 by jayn — 2012-04-04T14:18:53Z
cast(int)offset is found in lseek parameter in several places in the phobos library code.
phobos\mmfile.d(137): lseek(fd, cast(int)(size - 1), SEEK_SET);
phobos\mmfile.d(362): .lseek(fd, cast(int)(size - 1), SEEK_SET);
phobos\stream.d(1992): auto result = lseek(hFile, cast(int)offset, rel);
phobos\std\mmfile.d(130): lseek(fd, cast(int)(size - 1), SEEK_SET);
\phobos\std\stream.d(1987): auto result = lseek(hFile, cast(int)offset, rel);
I'd guess these int casts are contrary to the intent of the use of off_t redefinition to support 64 bit operations on linux and so the casts of the offset parameter should be changed to cast(off_t) in each of these cases.
Comment #1 by github-bugzilla — 2014-05-28T06:35:00Z