getrlimit changes
Philip Blundell
Philip.Blundell@pobox.com
Fri Nov 5 15:02:00 GMT 1999
>the kernel people recently changed (at least for x86) the types used
>for rlimit in the kernel to unsigned and changed the INIFITY values.
>I've checked in appropriate changes for the libc headers a few minutes
>ago but this is probably not enough as these new programs should work
>on old kernel. So I plan to add a wrapper around setrlimit() to limit
>the values passed in for old kernels to the old INFINITY value. Is
>there anything else missing? I don't think another architecture was
>effected, right?
Looks to me like all architectures are affected. The change was made to
struct rlimit in <linux/resource.h>:
-#define RLIM_INFINITY ((long)(~0UL>>1))
+/*
+ * SuS says limits have to be unsigned.
+ *
+ * Which makes a ton more sense anyway.
+ */
+#define RLIM_INFINITY (~0UL)
struct rlimit {
- long rlim_cur;
- long rlim_max;
+ unsigned long rlim_cur;
+ unsigned long rlim_max;
};
p.
More information about the Libc-hacker
mailing list