Hi All,
We have written a filter scheme driver and have an
application client in user space and a user client through which we send
request from user space to driver. Now our aim is to get the systems current
date and time. We have tried few things for the same but they give “EXEC_BAD_ACCESS”
error.
The fuction we have used is as below:
Struct timeval tv;
Struct timezone tz;
Int currentTime = gettimeofday(&tv,&tz);
Printf(“\n Cutrrent time =%d \n”, currentTime);
But if we compile this same code from command line “cc
–o .time UserSpaceApp.c “ and then run it.
Then it gives “Bus error”.
We have also tried another method to get current day and
time but get the same error.
char* strTime;
time_t currentTime = time(0);
strTime = ctime(currentTime);
Please guide us in getting current day and time of system.
Thanks and Regards,
Imran