setting system time from embedded application
I need to be able to set the system time from with in my embedded application. I am writing an app using Sourcery_G++ with the target being an phytec 3250 ARM9 running embedded Linux kernel 2.6.26. I know that I can set the system time from the command prompt using "date 092819402009" but what is the similar function calls from within an application?
thanks |
Look at stime(2).
|
setting system time
I tried using mktime() to set the system time from my embedded application, but it doesnt persist. I also have looked at stime(2), but from the documentation it doesnt appear that is the right way to go. I was looking at sys_clock_settime(), can anyone tell me about the usage of this routine from an embedded application?
thanks |
mktime() sets the operating system time. sys_clock_settime() allows the setting of an in-kernel clock, but it still won't set the hardware time. For hardware time, you need to look at something like hwclock.
|
All times are GMT -5. The time now is 05:52 AM. |