This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[ARM,MIPS,M68K] prlimit updates
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Date: Thu, 12 Aug 2010 15:48:11 +0000 (UTC)
- Subject: [ARM,MIPS,M68K] prlimit updates
This patch updates the ARM, MIPS and M68K ports for the recent addition of
prlimit/prlimit64 support to libc. I've committed the ARM and MIPS
changes; OK to commit the M68K changes?
The following need updating for a port for these changes:
* If the port has its own bits/resource.h file, that needs updating to add
the new declarations. Thus, Alpha maintainers may wish to update the
Alpha copy of this file.
* For 32-bit ports, and others not using
sysdeps/unix/sysv/linux/wordsize-64, syscalls.list needs updating to add
the new syscall, with either the entry from other 32-bit ports or the
entry from wordsize-64 as applicable. Thus, PA maintainers may wish to
update the PA syscalls.list. (MIPS n64 does not use
sysdeps/unix/sysv/linux/wordsize-64 because of differences between the
stat and stat64 structures, hence the changes here to three different
files for the three different MIPS ABIs to get the right syscall
definitions in each case.)
diff --git a/ChangeLog.arm b/ChangeLog.arm
index 8238431..f8cb056 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2010-08-12 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/syscalls.list: Add entry for
+ prlimit64 syscall.
+
2010-06-14 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_SETPIPE_SZ,
diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 284a3bf..4d3ffed 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2010-08-12 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/syscalls.list: Add entry for
+ prlimit64 syscall.
+
2010-08-02 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/m68k/coldfire/sysdep.h: New file.
diff --git a/ChangeLog.mips b/ChangeLog.mips
index b43fc65..d33ccab 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,12 @@
+2010-08-12 Joseph Myers <joseph@codesourcery.com>
+
+ * 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 <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETPIPE_SZ,
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index 1db0030..cc75737 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -3,3 +3,5 @@
syscall - syscall 7 syscall
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list
index 5367ef0..f479ef0 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -1,3 +1,5 @@
# File name Caller Syscall name Args Strong name Weak names
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 39d17d7..a6454c4 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 0000000..dbeb184
--- /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 5ade6f0..7a6a777 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 0000000..a7bccdd
--- /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
--
Joseph S. Myers
joseph@codesourcery.com