OSDN Git Service

libc: do not rely upon ulimit kernel syscall.
authorCarmelo Amoroso <carmelo.amoroso@st.com>
Tue, 1 Nov 2011 14:08:17 +0000 (15:08 +0100)
committerCarmelo Amoroso <carmelo.amoroso@st.com>
Wed, 23 Nov 2011 16:24:54 +0000 (17:24 +0100)
On several architectures __NR_ulimit syscall number is currently
defined but it is remapped onto sys_ni_syscall, while on other
architectures they are not longer defined.
So use {get,set}rlimit only to implement ulimit interface.

It fixes LTP ulimit01 test case.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/common/ulimit.c

index 74b4533..8be4a37 100644 (file)
@@ -7,13 +7,6 @@
 
 #include <sys/syscall.h>
 
-#ifdef __NR_ulimit
-
-extern long int ulimit(int cmd, long arg);
-_syscall2(long, ulimit, int, cmd, long, arg)
-
-#else
-
 #include <stdarg.h>
 #include <unistd.h>
 #include <ulimit.h>
@@ -53,4 +46,3 @@ long int ulimit(int cmd, ...)
        va_end (va);
        return result;
 }
-#endif