diff options
Diffstat (limited to 'bsd-user/bsd-proc.h')
-rw-r--r-- | bsd-user/bsd-proc.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bsd-user/bsd-proc.h b/bsd-user/bsd-proc.h index cb7c69a..133c1b0 100644 --- a/bsd-user/bsd-proc.h +++ b/bsd-user/bsd-proc.h @@ -124,4 +124,17 @@ static inline abi_long do_bsd_getlogin(abi_long arg1, abi_long arg2) return ret; } +/* getrusage(2) */ +static inline abi_long do_bsd_getrusage(abi_long who, abi_ulong target_addr) +{ + abi_long ret; + struct rusage rusage; + + ret = get_errno(getrusage(who, &rusage)); + if (!is_error(ret)) { + host_to_target_rusage(target_addr, &rusage); + } + return ret; +} + #endif /* !BSD_PROC_H_ */ |