some coverity fixes.
[minix.git] / lib / libc / sys-minix / lseek.c
blobfbcfb09aab7848a6d4d396a1bb456325a29d8f74
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
5 #include <unistd.h>
7 #ifdef __weak_alias
8 __weak_alias(lseek, _lseek)
9 #endif
11 off_t lseek(fd, offset, whence)
12 int fd;
13 off_t offset;
14 int whence;
16 message m;
18 m.m2_i1 = fd;
19 m.m2_l1 = offset;
20 m.m2_i2 = whence;
21 if (_syscall(VFS_PROC_NR, LSEEK, &m) < 0) return( (off_t) -1);
22 return( (off_t) m.m2_l1);