acassis commented on PR #3406:
URL: https://github.com/apache/nuttx-apps/pull/3406#issuecomment-3947216816

   > > > > > I read the review quickly and thought the issue was because of bss 
overflow and I initially suggested for it .. But since its flash overflow (as 
xip code/data) so I kept time module only for simulation case where there is a 
lot of memory to spare. I introduced a manual logic instead of libraries to 
reduce space for epoch calculation in microcontrollers , all the memory heavy 
implementations are conditional.
   > > > > 
   > > > > 
   > > > > Hi @Biancaa-R, this feature will have to work for all architectures, 
not just sim. Can you explain why you are setting the system clock, or why 
"/data" is stat'ed?
   > > > > In your checkpatch, use `-c -u -m` options too. This will catch the 
spelling errors reported by CI.
   > > > 
   > > > 
   > > > No it will work for all architectures that had enabled timekeeping 
config . In that case there is RTC to fall back on for the validity. If the 
epoch seconds is correct -> The conversion will produce the right result.
   > > > In case of simulation environments getting of the time ,(Using 
clk_gettime for puling current time from Linux Host) sometimes gave me faulty 
results from the system clock ,where the system clock often defaults to the 
Unix epoch or a fixed build date (like 2008/2004).
   > > > ```
   > > > nsh> date
   > > > Thu, Jan 22 18:08:41 2004 
   > > > nsh> date -s "Feb 23 22:35:00 2026"
   > > > ```
   > > > 
   > > > 
   > > >     
   > > >       
   > > >     
   > > > 
   > > >       
   > > >     
   > > > 
   > > >     
   > > >   
   > > > had to be done before creating the files from the cmd , If that was 
not handled , new files were created like this:
   > > > ```
   > > >  nsh> echo "hey" > hello.txt
   > > > 
   > > > nsh> ls -l
   > > > 
   > > > /:
   > > > 
   > > >  ----/--/-- --:-- dr-xr-xr-x           0 bin/
   > > > 
   > > >  2026-02-23 16:58:38 drwxrwxr-x        4096 data/
   > > > 
   > > >  2008-06-01 00:00:00 drwxrwxrwx           0 dev/
   > > > 
   > > >  ----/--/-- --:-- dr-xr-xr-x           0 etc/
   > > > 
   > > >  2004-01-22 18:08:50 -rw-rw-rw-           4 hello.txt
   > > > 
   > > >  2004-01-22 18:08:46 -rw-rw-rw-           3 hi.txt
   > > > 
   > > >  ----/--/-- --:-- dr--r--r--           0 proc/
   > > > 
   > > >  ----/--/-- --:-- drw-rw-rw-           0 tmp/ 
   > > > ```
   > > > 
   > > > 
   > > >     
   > > >       
   > > >     
   > > > 
   > > >       
   > > >     
   > > > 
   > > >     
   > > >   
   > > > but /data always takes in the right date so I forwarded it . stat() on 
a HostFS-mounted folder returns the right time and I am using it in this case.
   > > 
   > > 
   > > Okay. I don't think it's good separation of concerns that the `ls` 
command is doing platform-specific hacks to set the system time/correct it. The 
`ls` command should be able to assume that the system time is correct, and if 
it is not, it's up to the user to have the system time get updated elsewhere 
(i.e. sync with an NTP server).
   > 
   > If that concern for correcting time if it produces invalid it should be 
easier .. and everything would be mostly generic. can I remove it or keep it as 
else , as @acassis sir suggested ?
   
   @Biancaa-R I think @linguini1 is right, we don't need this hack to fix the 
issue on SIM. I will open an issue to map it.
   Thank you very much for your fix to display the date/time on "ls -l"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to