how to set time: update epoch value

Joel Sherrill joel at rtems.org
Tue Aug 11 17:33:35 UTC 2020


No problem.

That made me go look for a complete list of SVR4 APIs and I wasn't able to
find them. My first job was doing device drivers for SVR3 based
mini-computers and I may still have a paper copy at some volume of some
edition of the SVID (System V Interface Definition)  but back in those dark
ages, it was paper, comb-bound, and imposing. The API set appears to be
unavailable in a simple list but sco.com/developers/devspecs/ does have a
set of PDF (ok one file is Postscript).  I also found "UNIX Systems
Programming for SVR4" available electronically which includes a set of
example programs in a tar file.

https://www.bitsinthewind.com/about-dac/publications/unix-systems-programming


Might be interesting to see if the examples can be compiled for RTEMS.
Paging through the book, it looked pretty good. UNIX code never completely
goes out of date and the electronic edition was updated in 2014 so that's a
good sign it is useful.

But my going in hope was an easy list of APIs to add to the standards
tracking document. I know this is old but SVID is at least historically
important.

The sands of time are building up so I'll quit now. :)

--joel

On Tue, Aug 11, 2020 at 9:47 AM Ярослав Лещинский <midniwalker at gmail.com>
wrote:

> Thanks. Yes, clock_settime -- exactly what I was looking for.
>
> On Tue, 11 Aug 2020 at 16:29, Joel Sherrill <joel at rtems.org> wrote:
>
>>
>>
>> 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
>>
>>
>
> --
> --
> Kind regards,
> *Yaroslav Leshchinsky*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20200811/fb11a0dd/attachment-0001.html>


More information about the users mailing list