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:
Ingo Weinhold 2007-10-07 22:43:41 +00:00
parent 1ea618c556
commit ede3fe6c94

View File

@ -4,11 +4,19 @@
*/
#include <unistd.h>
#include <errno.h>
#include <syscalls.h>
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;
}