All pastes #342100 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-06 02:24 UTC
rendered paste body
asmlinkage int sys_getrusagepid (int pid) {
  struct task_struct *ts;
  int who = RUSAGE_SELF;
  struct rusage r;
  int a;

  ts = find_task_by_pid(pid);

  if (ts == NULL) {
    return -1;
  }

  a = getrusage(ts,who,&r);
  a++;

  return 1;
}