diff --git a/src/arch/alpha/linux/linux.hh b/src/arch/alpha/linux/linux.hh --- a/src/arch/alpha/linux/linux.hh +++ b/src/arch/alpha/linux/linux.hh @@ -132,22 +132,6 @@ /// 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_NOFILE = 6, - TGT_RLIMIT_AS = 7, - TGT_RLIMIT_VMEM = 7, - TGT_RLIMIT_NPROC = 8, - TGT_RLIMIT_MEMLOCK = 9, - TGT_RLIMIT_LOCKS = 10 - }; typedef struct { int64_t uptime; /* Seconds since boot */ diff --git a/src/arch/arm/linux/linux.hh b/src/arch/arm/linux/linux.hh --- a/src/arch/arm/linux/linux.hh +++ b/src/arch/arm/linux/linux.hh @@ -138,21 +138,6 @@ /// 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/mips/linux/linux.hh b/src/arch/mips/linux/linux.hh --- a/src/arch/mips/linux/linux.hh +++ b/src/arch/mips/linux/linux.hh @@ -128,23 +128,6 @@ /// For table(). static const int TBL_SYSINFO = 12; - /// Resource enumeration for getrlimit()/setrlimit(). - 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_NOFILE = 5, - TGT_RLIMIT_AS = 6, - TGT_RLIMIT_RSS = 7, - TGT_RLIMIT_VMEM = 7, - TGT_RLIMIT_NPROC = 8, - TGT_RLIMIT_MEMLOCK = 9, - TGT_RLIMIT_LOCKS = 10, - NUM_RLIMIT_RESOURCES - }; - /// Offset used to make sure that processes don't /// assign themselves to process IDs reserved for /// the root users. diff --git a/src/arch/x86/linux/syscalls.cc b/src/arch/x86/linux/syscalls.cc --- a/src/arch/x86/linux/syscalls.cc +++ b/src/arch/x86/linux/syscalls.cc @@ -310,8 +310,8 @@ /* 94 */ SyscallDesc("lchown", unimplementedFunc), /* 95 */ SyscallDesc("umask", unimplementedFunc), /* 96 */ SyscallDesc("gettimeofday", unimplementedFunc), - /* 97 */ SyscallDesc("getrlimit", unimplementedFunc), - /* 98 */ SyscallDesc("getrusage", unimplementedFunc), + /* 97 */ SyscallDesc("getrlimit", getrlimitFunc), + /* 98 */ SyscallDesc("getrusage", getrusageFunc), /* 99 */ SyscallDesc("sysinfo", sysinfoFunc), /* 100 */ SyscallDesc("times", timesFunc), /* 101 */ SyscallDesc("ptrace", unimplementedFunc), @@ -568,8 +568,8 @@ /* 73 */ SyscallDesc("sigpending", unimplementedFunc), /* 74 */ SyscallDesc("sethostname", unimplementedFunc), /* 75 */ SyscallDesc("setrlimit", ignoreFunc), - /* 76 */ SyscallDesc("getrlimit", unimplementedFunc), - /* 77 */ SyscallDesc("getrusage", unimplementedFunc), + /* 76 */ SyscallDesc("getrlimit", getrlimitFunc), + /* 77 */ SyscallDesc("getrusage", getrusageFunc), /* 78 */ SyscallDesc("gettimeofday", unimplementedFunc), /* 79 */ SyscallDesc("settimeofday", unimplementedFunc), /* 80 */ SyscallDesc("getgroups", unimplementedFunc), diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh --- a/src/kern/linux/linux.hh +++ b/src/kern/linux/linux.hh @@ -148,7 +148,32 @@ }; + /// 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, + RLIMIT_NPROC = 6, + TGT_RLIMIT_NOFILE = 7, + RLIMIT_MEMLOCK = 8, + TGT_RLIMIT_AS = 9, + RLIMIT_LOCKS = 10, + RLIMIT_SIGPENDING = 11, + RLIMIT_MSGQUEUE = 12, + RLIMIT_NICE = 13, + RLIMIT_RTPRIO = 14, + RLIMIT_RTTIME = 15, + RLIM_NLIMITS = 16, + }; + /// For getrusage(). + static const int TGT_RUSAGE_SELF = 0; + static const int TGT_RUSAGE_CHILDREN = -1; + static const int TGT_RUSAGE_BOTH = -2; + struct rusage { struct timeval ru_utime; //!< user time used struct timeval ru_stime; //!< system time used