POSIX functions return their error codes via errno and so does lseek().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22479 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,11 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <syscalls.h>
|
#include <syscalls.h>
|
||||||
|
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
lseek(int fd, off_t pos, int whence)
|
lseek(int fd, off_t pos, int whence)
|
||||||
{
|
{
|
||||||
return _kern_seek(fd, pos, whence);
|
off_t result = _kern_seek(fd, pos, whence);
|
||||||
|
if (result < 0) {
|
||||||
|
errno = result;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user