The getrusage function gets you the current usage . (see man getrusage). The getrlimit function in linux ...
stackoverflow.com