OSDN Git Service

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