• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <unistd.h>
2 #include "syscall.h"
3 
__lseek(int fd,off_t offset,int whence)4 off_t __lseek(int fd, off_t offset, int whence)
5 {
6 	register long long r4 __asm__("$4") = fd;
7 	register long long r5 __asm__("$5") = offset;
8 	register long long r6 __asm__("$6") = whence;
9 	register long long r7 __asm__("$7");
10 	register long long r2 __asm__("$2") = SYS_lseek;
11 	__asm__ __volatile__ (
12 		"syscall"
13 		: "+&r"(r2), "=r"(r7)
14 		: "r"(r4), "r"(r5), "r"(r6)
15 		: SYSCALL_CLOBBERLIST);
16 	return r7 ? __syscall_ret(-r2) : r2;
17 }
18 
19 weak_alias(__lseek, lseek);
20 weak_alias(__lseek, lseek64);
21