[RTEMS Project] #2182: broken RTEMS CLOCKS_PER_SEC interface, when including only time.h

RTEMS trac trac at rtems.org
Thu Dec 18 12:38:35 UTC 2014


#2182: broken RTEMS CLOCKS_PER_SEC interface, when including only time.h
--------------------+----------------------------
 Reporter:  johill  |       Owner:  joel.sherrill
     Type:  defect  |      Status:  new
 Priority:  normal  |   Milestone:  4.11
Component:  libcpu  |     Version:  4.10
 Severity:  normal  |  Resolution:
 Keywords:          |
--------------------+----------------------------

Old description:

> I had to patch Lua (a very portable code) as follows for RTEMS 4.10. I
> had a look around in the source and maybe its not possible for
> _SC_CLK_TCK to be properly defined when expecting to include only the
> standard C lib clock interface via time.h. Maybe its fixed in 4.11, but
> nevertheless I should probably file a bug report while I see the issue,
> in case it isn’t.
>
> /*
>  * repair broken RTEMS CLOCKS_PER_SEC interface
>  */
> #ifdef __rtems__
> #  include <sys/unistd.h>
> #endif

New description:

 I had to patch Lua (a very portable code) as follows for RTEMS 4.10. I had
 a look around in the source and maybe its not possible for _SC_CLK_TCK to
 be properly defined when expecting to include only the standard C lib
 clock interface via time.h. Maybe its fixed in 4.11, but nevertheless I
 should probably file a bug report while I see the issue, in case it isn’t.

 /*
  * repair broken RTEMS CLOCKS_PER_SEC interface
  */
 #ifdef __rtems__
 #  include <sys/unistd.h>
 #endif

--

Comment (by sebastian.huber):

 POSIX says that CLOCKS_PER_SEC is one million.  So it seems this mapping
 to _SC_CLK_TCK is wrong.

 http://pubs.opengroup.org/onlinepubs/009695399/functions/clock.html

--
Ticket URL: <http://devel.rtems.org/ticket/2182#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list