how to set time: update epoch value
Joel Sherrill
joel at rtems.org
Tue Aug 11 14:28:55 UTC 2020
On Tue, Aug 11, 2020 at 9:07 AM Ярослав Лещинский <midniwalker at gmail.com>
wrote:
> Hello,
>
> I'm looking for a method like int stime(time_t *t); to update epoch value.
> Can someone tell me the way how to set time properly?
>
I had to look up stime(). That's a System V R4 method that I have never
used. It sure isn't part of POSIX.
The POSIX way is clock_settime(CLOCK_REALTIME,...).
The Classic API way is rtems_clock_set().
cpukit/libmisc/shell/main_date.c has a simple example of using
clock_settime().
Interesting that there has never been a mention of stime() before.
--joel
> Thanks.
>
> --
> --
> Kind regards,
> *Yaroslav Leshchinsky*
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20200811/f0dd1081/attachment.html>
More information about the users
mailing list