From c16fd24675beb336d1b2f1a65bbb1d644e5361c8 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 12 Aug 2010 15:40:29 +0000 Subject: [PATCH] Add prlimit64 for MIPS. --- ChangeLog.mips | 9 ++++++ sysdeps/unix/sysv/linux/mips/bits/resource.h | 30 ++++++++++++++++++- .../unix/sysv/linux/mips/mips32/syscalls.list | 3 ++ .../sysv/linux/mips/mips64/n32/syscalls.list | 2 ++ .../sysv/linux/mips/mips64/n64/syscalls.list | 3 ++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list diff --git a/ChangeLog.mips b/ChangeLog.mips index b43fc6591f..d33ccabba3 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,3 +1,12 @@ +2010-08-12 Joseph Myers + + * sysdeps/unix/sysv/linux/mips/bits/resource.h: Declare prlimit + and prlimit64. + * sysdeps/unix/sysv/linux/mips/mips32/syscalls.list, + sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: New files. + * sysdeps/unix/sysv/linux/mips/n32/syscalls.list: Add entry for + prlimit64 syscall. + 2010-06-14 Joseph Myers * sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETPIPE_SZ, diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h index 39d17d74f7..a6454c4849 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/resource.h +++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h @@ -1,6 +1,6 @@ /* Bit values & structures for resource limits. Linux/MIPS version. Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 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 @@ -240,3 +240,31 @@ enum __priority_which PRIO_USER = 2 /* WHO is a user ID. */ #define PRIO_USER PRIO_USER }; + + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Modify and return resource limits of a process atomically. */ +# ifndef __USE_FILE_OFFSET64 +extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, + __const struct rlimit *__new_limit, + struct rlimit *__old_limit) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, + enum __rlimit_resource __resource, + __const struct rlimit *__new_limit, + struct rlimit *__old_limit), prlimit64); +# else +# define prlimit prlimit64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, + __const struct rlimit64 *__new_limit, + struct rlimit64 *__old_limit) __THROW; +# endif +#endif + +__END_DECLS diff --git a/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list new file mode 100644 index 0000000000..dbeb184d73 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list @@ -0,0 +1,3 @@ +# File name Caller Syscall name # args Strong name Weak names + +prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list index 5ade6f0076..7a6a777797 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -4,3 +4,5 @@ readahead - readahead i:iii __readahead readahead sync_file_range - sync_file_range i:iiii sync_file_range ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64 truncate - truncate i:si truncate truncate64 + +prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list new file mode 100644 index 0000000000..a7bccdd376 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list @@ -0,0 +1,3 @@ +# File name Caller Syscall name # args Strong name Weak names + +prlimit EXTRA prlimit64 i:iipp prlimit prlimit64