patch-2.3.25 linux/kernel/sys.c
Next file: linux/kernel/sysctl.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index
- Lines: 26
- Date:
Fri Oct 29 13:19:49 1999
- Orig file:
v2.3.24/linux/kernel/sys.c
- Orig date:
Sat Oct 9 11:47:50 1999
diff -u --recursive --new-file v2.3.24/linux/kernel/sys.c linux/kernel/sys.c
@@ -889,6 +889,25 @@
? -EFAULT : 0;
}
+/*
+ * Back compatibility for getrlimit. Needed for some apps.
+ */
+
+asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit *rlim)
+{
+ struct rlimit x;
+ if (resource >= RLIM_NLIMITS)
+ return -EINVAL;
+
+ memcpy(&x, current->rlim + resource, sizeof(*rlim));
+ if(x.rlim_cur > 0x7FFFFFFF)
+ x.rlim_cur = 0x7FFFFFFF;
+ if(x.rlim_max > 0x7FFFFFFF)
+ x.rlim_max = 0x7FFFFFFF;
+ return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
+}
+
+
asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim)
{
struct rlimit new_rlim, *old_rlim;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)