All pastes #342030 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-06 01:24 UTC
rendered paste body
#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)