RTEMS | Cannot obtain dates later than 2100 (!339)

Joel Sherrill (@joel) gitlab at rtems.org
Tue Feb 11 22:42:07 UTC 2025



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339 was reviewed by Joel Sherrill

--
  
Joel Sherrill commented on a discussion on cpukit/rtems/src/clockgettod.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119728

 > -    }
 > -  }
 > +  current_time_tm = gmtime_r( &now.tv_sec, &buf );

This looks like a good idea. Whether the implementation of gmtime_r() returns an error is independent of us checking it. Static analysers will notice.

--
  
Joel Sherrill commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119729


@zakthertemsdev Can you add test checks that every field in the returned structure has the expected value? I agree with @gedare that this is a test deficiency.

--
  
Joel Sherrill commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119730


We have tm08 which can be used to measure the before and after time impact. 

The size impact can be done by seeing what the size is of a relocatable with rtems_clock_get_tod undefined and linking against librtemscpu.a and the appropriate libc.a. I had this m68k BSP built from trying to remove warnings. This is what I tried:

```
$ sh -x /tmp/x3
+ m68k-rtems7-ld -r -o file.rel --undefined=rtems_clock_get_tod /home/joel/rtems-work/rtems/b-COBRA5475/m68k/COBRA5475/librtemscpu.a /home/joel/rtems-work/tools/7/m68k-rtems7/lib/m5475/libc.a
+ m68k-rtems7-size file.rel
   text	   data	    bss	    dec	    hex	filename
  41186	    260	   1209	  42655	   a69f	file.rel
```

Using nm, it looks like the call into the score results in more coming in than the TOD conversion.

@zakthertemsdev What BSP are you using? I can do the before and you the after data if @gedare and @chris are ok with this approach. I don't know what else could be gathered.


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250211/bbf6cfa5/attachment.htm>


More information about the bugs mailing list