SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)

Message ID 1400065575-31643-1-git-send-email-aurelien@aurel32.net
State Committed
Headers

Commit Message

Aurelien Jarno May 14, 2014, 11:06 a.m. UTC
  prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>
---
 ChangeLog                                     |  6 ++++++
 NEWS                                          |  2 +-
 sysdeps/unix/sysv/linux/sparc/bits/resource.h | 27 +++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
  

Comments

David Miller May 14, 2014, 7:24 p.m. UTC | #1
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Wed, 14 May 2014 13:06:15 +0200

> prlimit and prlimit64 have been added in the main <bits/resource.h>, but
> not in the SPARC specific version. Fix that.
> 
> Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
> <pochu@debian.org>

Looks good, please commit and also add it to any relevant release branches.

Thanks a lot for fixing these sparc loose ends, I really appreciate it.
  
Joseph Myers May 15, 2014, 10:52 p.m. UTC | #2
Remember to close bugs after committing fixes for them....
  
Aurelien Jarno May 15, 2014, 11 p.m. UTC | #3
On Thu, May 15, 2014 at 10:52:39PM +0000, Joseph S. Myers wrote:
> Remember to close bugs after committing fixes for them....

Thanks for the reminder. I have seen the commits message arriving in
bugzilla, I only noticed now that the bugs are not automatically closed
at the same time.

That should be fixed now, sorry about that.
  

Patch

diff --git a/ChangeLog b/ChangeLog
index 04fdbe1..62e0a7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@ 
 2014-05-14  Aurelien Jarno  <aurelien@aurel32.net>
 
+	[BZ #16943]
+	* sysdeps/unix/sysv/linux/sparc/bits/resource.h: Declare prlimit
+	and prlimit64.
+
+2014-05-14  Aurelien Jarno  <aurelien@aurel32.net>
+
 	[BZ #16917]
 	* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): Return
 	errno if the TIOCGPTN ioctl fails with an error different than
diff --git a/NEWS b/NEWS
index f081e8e..42a5ecf 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@  Version 2.20
   16714, 16731, 16739, 16740, 16743, 16754, 16758, 16759, 16760, 16770,
   16786, 16789, 16791, 16799, 16800, 16815, 16823, 16824, 16831, 16838,
   16854, 16876, 16877, 16885, 16888, 16890, 16912, 16915, 16916, 16917,
-  16922, 16932.
+  16922, 16932, 16943.
 
 * The minimum Linux kernel version that this version of the GNU C Library
   can be used with is 2.6.32.
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index aa201fe..518264f 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -252,3 +252,30 @@  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