From: Daniel Jacobowitz Date: Wed, 23 May 2007 17:26:13 +0000 (+0000) Subject: * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file. X-Git-Tag: glibc-2.16-ports-merge^2~773 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a30cb832315de0a6dc546d110726ed9952df82e;p=platform%2Fupstream%2Fglibc.git * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file. * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: New file. * sysdeps/unix/sysv/linux/mips/mips32/readahead.c: New file. * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: New file. * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: New file. * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: New file. --- diff --git a/ChangeLog.mips b/ChangeLog.mips index 2b5754f..3ef0903 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,3 +1,12 @@ +2007-05-23 Atsushi Nemoto + + * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file. + * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: New file. + * sysdeps/unix/sysv/linux/mips/mips32/readahead.c: New file. + * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: New file. + * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: New file. + * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: New file. + 2007-05-23 Joseph Myers * sysdeps/mips/mips64/n32/Implies: Add mips/mips64/soft-fp. diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c new file mode 100644 index 0000000..24cbdf2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0, + __LONG_LONG_PAIR (offset >> 31, offset), + __LONG_LONG_PAIR (offset >> 31, len), + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c new file mode 100644 index 0000000..715d37e --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c @@ -0,0 +1,61 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0, + __LONG_LONG_PAIR ((long) (offset >> 32), + (long) offset), + __LONG_LONG_PAIR ((long) (len >> 32), + (long) len), + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} + +#include + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +attribute_compat_text_section +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) +{ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} + +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +#else +strong_alias (__posix_fadvise64_l64, posix_fadvise64); +#endif diff --git a/sysdeps/unix/sysv/linux/mips/mips32/readahead.c b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c new file mode 100644 index 0000000..b5b967c --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c new file mode 100644 index 0000000..13a21b0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c @@ -0,0 +1,47 @@ +/* Selective file content synch'ing. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +#include +#include + + +#ifdef __NR_sync_file_range +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + return INLINE_SYSCALL (sync_file_range, 7, fd, 0, + __LONG_LONG_PAIR ((long) (from >> 32), (long) from), + __LONG_LONG_PAIR ((long) (to >> 32), (long) to), + flags); +} +#else +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (sync_file_range) + +# include +#endif diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c new file mode 100644 index 0000000..40bafdb --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c @@ -0,0 +1,56 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} + +#include + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +attribute_compat_text_section +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) +{ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} + +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +#else +strong_alias (__posix_fadvise64_l64, posix_fadvise64); +#endif diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list new file mode 100644 index 0000000..babdba0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -0,0 +1,5 @@ +# File name Caller Syscall name # args Strong name Weak names + +readahead - readahead i:iii __readahead readahead +sync_file_range - sync_file_range i:iiii sync_file_range +posix_fadvise - fadvise64 i:iiii posix_fadvise