Fail legacy interfaces if the position is too large for them to represent
commit59f388a67f9319d79d123a42feecf8a6efba764e
authorJakub Jermar <jakub@jermar.eu>
Tue, 4 Apr 2017 20:56:47 +0000 (4 22:56 +0200)
committerJakub Jermar <jakub@jermar.eu>
Tue, 4 Apr 2017 20:56:47 +0000 (4 22:56 +0200)
treef53f4214ea9cd1955f6f6b1e4a7b609b19a72d26
parent8fe46a0f40ff74ca91e8c0f7ece6d2b75eac9029
Fail legacy interfaces if the position is too large for them to represent

HelenOS interfaces support unsigned 64-bit file sizes and offsets. This
is in contrast with C99-ish and POSIX-ish interfaces in libc and libposix.
The legacy API emulation internally uses the native unsigned 64-bit file
sizes and positions and so it may happen that a returned file size or
offset are bigger than the legacy interface can represent. We choose
to report failure in such a case in order to avoid returning wrong
results.
uspace/lib/c/generic/io/io.c
uspace/lib/posix/source/sys/stat.c
uspace/lib/posix/source/unistd.c