Untitled
public text v1 · immutable#include <linux/getrusagepid.h>
asmlinkage int sys_getrusagepid (int pid) {
struct task_struct *ts = find_task_by_pid(pid);
if (ts == NULL) {
return -1;
}
int who = RUSAGE_SELF;
struct rusage r;
int a = getrusage(ts,who,&r);
a++;
return 1;
}
getrusagepid.c: In function `sys_getrusagepid':
getrusagepid.c:10: parse error before `int'
getrusagepid.c:13: `a' undeclared (first use in this function)