Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posix: implement _POSIX_THREAD_SAFE_FUNCTIONS's time functions #74180

Merged
merged 2 commits into from
Aug 21, 2024

Commits on Aug 21, 2024

  1. lib: posix: update option group of readdir_r()

    `readdir_r()` belongs to the following option group
    
    POSIX_FILE_SYSTEM_R: Thread-Safe File System
    
    Create a new Kconfig `CONFIG_POSIX_FILE_SYSTEM_R` to compile
    it.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    ycsin committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    7f7bba5 View commit details
    Browse the repository at this point in the history
  2. libc: common: implement multiple time functions

    Implemented the following:
    - `asctime_r()`
    - `asctime()`
    - `localtime()`
    - `localtime_r()`
    - `ctime()`
    - `ctime_r()`
    
    Specifically:
    - the implementation of `localtime()` & `localtime_r()` simply
      wraps around the gmtime() & gmtime_r() functions, the
      results are always expressed as UTC.
    - `ctime()` is equivalent to `asctime(localtime(clock))`, it
      inherits the limitation of `localtime()` as well, which only
      supports UTC results currently.
    
    Added tests for these newly implemented functions.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    ycsin committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    12c7543 View commit details
    Browse the repository at this point in the history