diff --git a/src/system/libroot/posix/unistd/lseek.c b/src/system/libroot/posix/unistd/lseek.c index a871bfd510..acf14ec27e 100644 --- a/src/system/libroot/posix/unistd/lseek.c +++ b/src/system/libroot/posix/unistd/lseek.c @@ -4,11 +4,19 @@ */ #include + +#include + #include off_t 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; }