1 /*
2  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3  *
4  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5  */
6 
7 #include <sys/syscall.h>
8 #include <unistd.h>
9 #include <endian.h>
10 #include <sgidefs.h>
11 
12 /* We should generalize this for 32bit userlands w/64bit regs.  This applies
13  * to the x86_64 x32 and the mips n32 ABIs.  */
14 #if _MIPS_SIM == _MIPS_SIM_NABI32
15 # define __NR___syscall_pread __NR_pread64
16 static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset)
17 # define MY_PREAD(fd, buf, count, offset) \
18 	__syscall_pread(fd, buf, count, offset)
19 # define MY_PREAD64(fd, buf, count, offset) \
20 	__syscall_pread(fd, buf, count, offset)
21 
22 # define __NR___syscall_pwrite __NR_pwrite64
23 static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
24 # define MY_PWRITE(fd, buf, count, offset) \
25 	__syscall_pwrite(fd, buf, count, offset)
26 # define MY_PWRITE64(fd, buf, count, offset) \
27 	__syscall_pwrite(fd, buf, count, offset)
28 #endif
29 
30 #include "../common/pread_write.c"
31