[power-gnu-discuss] getrusage

Carlos O'Donell carlos at codesourcery.com
Thu Feb 3 16:07:54 UTC 2011


On 2/3/2011 6:08 AM, Frank Juergen-R58616 wrote:
> Seems the function times calls the function getrusage, but this
> function isn’t defined anywhere. Any hints what I have to do ? And for
> what this function is used.
> 
> I run the code on an system without any OS.  
> c:/program
> files/codesourcery/sourceryglite/bin/../lib/gcc/powerpc-eabi/4.5.1/../../../../powerpc-eabi/lib\libc.a(lib_a-times.o):
> In function `times':
> 
> times.c:(.text+0x20): undefined reference to `getrusage'

You need to define a getrusage function in your code which does
whatever is needed for your bare-metal application. It's up to you to
decide how to count time (given that you have no OS).

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos at codesourcery.com
+1 (650) 331-3385 x716



More information about the power-gnu-discuss mailing list