2

I've been looking into the getrusage function, which I see a prototype for within the file
/include/linux/resource.h. I've tried to trace the directives to find where the actual function is, but I haven't found it. Does anyone know where it is?

  • 1
    You mean the _implementation_ of it? It's part of the GNU C library. You would have to get that library's source code. – Kusalananda Jun 26 '19 at 17:13
  • getrusage(2) is a system call, the getrusage(2) function from the GNU C library is just a thin wrapper (which may even be autogenerated). The getrusage() linux kernel implementation is [here](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sys.c?id=249155c20f9b0754bc1b932a33344cfb4e0c2101#n1715). –  Jun 27 '19 at 05:08

0 Answers0