xref: /haiku/src/system/libroot/posix/unistd/lseek.c (revision e6b30aee0fd7a23d6a6baab9f3718945a0cd838a)
1 /*
2 ** Copyright 2001, Manuel J. Petit. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 
6 #include <unistd.h>
7 
8 #include <errno.h>
9 
10 #include <syscalls.h>
11 
12 
13 off_t
14 lseek(int fd, off_t pos, int whence)
15 {
16 	off_t result = _kern_seek(fd, pos, whence);
17 	if (result < 0) {
18 		errno = result;
19 		return -1;
20 	}
21 	return result;
22 }
23