fix RLIMIT_ constants for mips
authorSzabolcs Nagy <nsz@port70.net>
Mon, 14 Apr 2014 15:42:49 +0000 (17:42 +0200)
committerRich Felker <dalias@aerifal.cx>
Tue, 15 Apr 2014 23:17:52 +0000 (19:17 -0400)
The mips arch is special in that it uses different RLIMIT_
numbers than other archs, so allow bits/resource.h to override
the default RLIMIT_ numbers (empty on all archs except mips).
Reported by orc.

arch/arm/bits/resource.h [new file with mode: 0644]
arch/i386/bits/resource.h [new file with mode: 0644]
arch/microblaze/bits/resource.h [new file with mode: 0644]
arch/mips/bits/resource.h [new file with mode: 0644]
arch/powerpc/bits/resource.h [new file with mode: 0644]
arch/sh/bits/resource.h [new file with mode: 0644]
arch/x32/bits/resource.h [new file with mode: 0644]
arch/x86_64/bits/resource.h [new file with mode: 0644]
include/sys/resource.h

diff --git a/arch/arm/bits/resource.h b/arch/arm/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/i386/bits/resource.h b/arch/i386/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/microblaze/bits/resource.h b/arch/microblaze/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/mips/bits/resource.h b/arch/mips/bits/resource.h
new file mode 100644 (file)
index 0000000..414a405
--- /dev/null
@@ -0,0 +1,5 @@
+#define RLIMIT_NOFILE  5
+#define RLIMIT_AS      6
+#define RLIMIT_RSS     7
+#define RLIMIT_NPROC   8
+#define RLIMIT_MEMLOCK 9
diff --git a/arch/powerpc/bits/resource.h b/arch/powerpc/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/sh/bits/resource.h b/arch/sh/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/x32/bits/resource.h b/arch/x32/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/x86_64/bits/resource.h b/arch/x86_64/bits/resource.h
new file mode 100644 (file)
index 0000000..e69de29
index 7fd6a375b69f7b9946a3a28fe618ee9080896aaf..58392d64ba8f0792d29b2302fcb774a62f383214 100644 (file)
@@ -15,6 +15,7 @@ extern "C" {
 #endif
 
 #include <bits/alltypes.h>
+#include <bits/resource.h>
 
 typedef unsigned long long rlim_t;
 
@@ -78,11 +79,13 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
 #define RLIMIT_DATA    2
 #define RLIMIT_STACK   3
 #define RLIMIT_CORE    4
+#ifndef RLIMIT_RSS
 #define RLIMIT_RSS     5
-#define RLIMIT_NOFILE  7
-#define RLIMIT_AS      9
 #define RLIMIT_NPROC   6
+#define RLIMIT_NOFILE  7
 #define RLIMIT_MEMLOCK 8
+#define RLIMIT_AS      9
+#endif
 #define RLIMIT_LOCKS   10
 #define RLIMIT_SIGPENDING 11
 #define RLIMIT_MSGQUEUE 12