xref: /minix3/minix/lib/libc/sys/getrusage.c (revision bc2d75fa05289d971b2669f2f8593daa1524eb58)
1433d6423SLionel Sambuc #include <sys/cdefs.h>
2433d6423SLionel Sambuc #include "namespace.h"
3433d6423SLionel Sambuc #include <lib.h>
4433d6423SLionel Sambuc 
5433d6423SLionel Sambuc #include <string.h>
6433d6423SLionel Sambuc #include <unistd.h>
7433d6423SLionel Sambuc #include <sys/resource.h>
8433d6423SLionel Sambuc 
9*bc2d75faSDavid van Moolenbroek int
getrusage(int who,struct rusage * r_usage)10*bc2d75faSDavid van Moolenbroek getrusage(int who, struct rusage * r_usage)
11433d6423SLionel Sambuc {
12433d6423SLionel Sambuc 	message m;
13433d6423SLionel Sambuc 
14433d6423SLionel Sambuc 	memset(&m, 0, sizeof(m));
15433d6423SLionel Sambuc 	m.m_lc_pm_rusage.who = who;
16433d6423SLionel Sambuc 	m.m_lc_pm_rusage.addr = (vir_bytes)r_usage;
17433d6423SLionel Sambuc 
18*bc2d75faSDavid van Moolenbroek 	return _syscall(PM_PROC_NR, PM_GETRUSAGE, &m);
19433d6423SLionel Sambuc }
20