Issue using times function in Intel MAC

S

sjain

Guest
Hi All,

I am getting this strange error on Intel MAC OS whereever i use
times(NULL) function.

I am using the following piece of code:

#include <time.h>
int main()
{
1 clock_t myTime;
2 myTime = times(NULL);
3 return(0);
}

The progarm compiles sucessfully, but on running the application, it throws the following error at line 2:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x900a3fb2 in times ()

Can anybody help me out with this problem. This seems to be Intel MAC specific. I dont face any issue with this piece of code on any other unix based system.

Thanks a lot in advance
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top