From 7cef6b9befea7e4cc4138eb1b01d45dd777bd72f Mon Sep 17 00:00:00 2001 From: Marc Orr Date: Mon, 6 Aug 2012 19:52:56 -0700 Subject: syscall emulation: Enabled getrlimit and getrusage for x86. Added/moved rlimit constants to base linux header file. This patch is a revised version of Vince Weaver's earlier patch. --- src/arch/arm/linux/linux.hh | 22 ---------------------- src/arch/arm/linux/process.cc | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) (limited to 'src/arch/arm/linux') diff --git a/src/arch/arm/linux/linux.hh b/src/arch/arm/linux/linux.hh index 55af574d3..5a3e68a78 100644 --- a/src/arch/arm/linux/linux.hh +++ b/src/arch/arm/linux/linux.hh @@ -93,31 +93,9 @@ class ArmLinux : public Linux static const unsigned TGT_MAP_ANONYMOUS = 0x20; static const unsigned TGT_MAP_FIXED = 0x10; - //@{ - /// For getrusage(). - static const int TGT_RUSAGE_SELF = 0; - static const int TGT_RUSAGE_CHILDREN = -1; - static const int TGT_RUSAGE_BOTH = -2; - //@} - /// For table(). static const int TBL_SYSINFO = 12; - /// Resource enumeration for getrlimit(). - enum rlimit_resources { - TGT_RLIMIT_CPU = 0, - TGT_RLIMIT_FSIZE = 1, - TGT_RLIMIT_DATA = 2, - TGT_RLIMIT_STACK = 3, - TGT_RLIMIT_CORE = 4, - TGT_RLIMIT_RSS = 5, - TGT_RLIMIT_NPROC = 6, - TGT_RLIMIT_NOFILE = 7, - TGT_RLIMIT_MEMLOCK = 8, - TGT_RLIMIT_AS = 9, - TGT_RLIMIT_LOCKS = 10 - }; - /// Limit struct for getrlimit/setrlimit. struct rlimit { uint32_t rlim_cur; //!< soft limit diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index a30b1f440..088f9907e 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -151,7 +151,7 @@ SyscallDesc ArmLinuxProcess::syscallDescs[] = { /* 73 */ SyscallDesc("sigpending", unimplementedFunc), /* 74 */ SyscallDesc("sethostname", ignoreFunc), /* 75 */ SyscallDesc("setrlimit", ignoreFunc), - /* 76 */ SyscallDesc("getrlimit", unimplementedFunc), + /* 76 */ SyscallDesc("getrlimit", getrlimitFunc), /* 77 */ SyscallDesc("getrusage", getrusageFunc), /* 78 */ SyscallDesc("gettimeofday", gettimeofdayFunc), /* 79 */ SyscallDesc("settimeofday", unimplementedFunc), -- cgit v1.2.3