2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
#include <lib.h>
|
|
|
|
|
2013-03-07 16:55:22 +01:00
|
|
|
#include <minix/u64.h>
|
2011-02-17 18:11:09 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifdef __weak_alias
|
|
|
|
__weak_alias(lseek, _lseek)
|
|
|
|
#endif
|
|
|
|
|
2013-03-07 16:55:22 +01:00
|
|
|
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;
|
|
|
|
|
2013-08-31 23:11:34 +02:00
|
|
|
if (_syscall(VFS_PROC_NR, LSEEK, &m) < 0)
|
2013-03-07 16:55:22 +01:00
|
|
|
return( (off_t) -1);
|
2013-08-31 23:11:34 +02:00
|
|
|
|
2013-03-07 16:55:22 +01:00
|
|
|
return( (off_t) make64(m.m2_l1, m.m2_l2));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|