jingfei195887 opened a new pull request, #21685:
URL: https://github.com/apache/nuttx/pull/21685

   ## Summary
   
   POSIX says `readdir()` marks the last data access time of the directory
   for update. With `CONFIG_PSEUDOFS_ATTRIBUTES` the pseudo file system
   keeps `i_atime` and reports it through `stat()`, but `dir_read()`
   never updates it for pseudo directories. Update it after reading an
   entry.
   
   ## Impact
   
   `stat()` on a pseudo directory now reports the time of the last
   `readdir()`. Mount points and builds without
   `CONFIG_PSEUDOFS_ATTRIBUTES` are unchanged.
   
   ## Testing
   
   Host: Ubuntu x86_64, gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, master 
03aea78639, `sim:nsh`
   (`CONFIG_PSEUDOFS_ATTRIBUTES=y` is the default there). A small test
   program creates `/fsup_d` with `mkdir()`, reads `st_atim`, waits two
   seconds, reads the directory to the end and calls `stat()` again:
   
   | | master | this PR |
   |---|---|---|
   | `st_atim` after `readdir()` | unchanged | updated (+2 s) |
   
   - `./tools/checkpatch.sh -g master..HEAD`: all checks pass.
   - Make and CMake builds pass; `ostest` exits with status 0.
   


-- 
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