minix/lib/libc/sys-minix/lseek.c
David van Moolenbroek 24ed4e38de Remove support for obsolete 3.2.1 ABI
Change-Id: I76b4960bda41f55d9c42f8c99c5beae3424ca851
2014-02-18 11:25:02 +01:00

26 lines
433 B
C

#include <sys/cdefs.h>
#include "namespace.h"
#include <lib.h>
#include <minix/u64.h>
#include <unistd.h>
#ifdef __weak_alias
__weak_alias(lseek, _lseek)
#endif
off_t
lseek(int fd, off_t offset, int whence)
{
message m;
m.m2_i1 = fd;
m.m2_l1 = ex64lo(offset);
m.m2_l2 = ex64hi(offset);
m.m2_i2 = whence;
if (_syscall(VFS_PROC_NR, LSEEK, &m) < 0)
return( (off_t) -1);
return( (off_t) make64(m.m2_l1, m.m2_l2));
}