summaryrefslogtreecommitdiff
path: root/components/libc/posix
AgeCommit message (Collapse)Author
2026-08-30[libc][posix] Wake epoll waiters on OOMbernard
If waiter allocation fails, mark the fd with POLLERR and wake epoll_wait() instead of silently dropping the watch.
2026-08-30[libc][posix] Fix epoll waiters and LWP syscall copiesbernard
修复 epoll waiter 生命周期,避免等待队列节点在回调后失效。 整理 LWP POSIX syscall 的用户空间拷贝和错误返回路径。
2026-07-01fix pthread cond wait schedulingOld-Ding
2026-05-26为posix_signal.c文件中的signal函数进行注释langqwu
2026-04-14[libc][libdl] Fix dlopen() failing to find already-loaded modulesCopilot
2026-03-12components: libc: fix reset static variable unsolved in ↵kenneth.liu
dlmodule_load_shared_object [Problem Description] In the dlmodule_load_shared_object function, if a module loading fails once due to an unresolved symbol, all subsequent attempts to load any module will fail. The system becomes unable to load modules correctly until a reboot. [Problem Analysis] The root cause is that the variable unsolved is defined as static. Static variables retain their value between function calls. If a relocation error occurs, unsolved is set to RT_TRUE. However, when the function returns with an error, the value of unsolved is not reset. Consequently, on the next function call, unsolved remains RT_TRUE from the previous execution. This causes the check if (unsolved) to trigger immediately (or after the loop), forcing the function to return an error regardless of whether the current module is valid or not. [Solution] Reset the unsolved variable to RT_FALSE before returning the error code -RT_ERROR. This ensures the variable is in a clean state for the next function call, preventing state leakage between invocations. Signed-off-by: Liu Gui <[email protected]>
2026-02-24[libc/posix] Fix mq_send() to block when queue is full per POSIX standardhzt
The POSIX mq_send() function currently passes timeout=0 to rt_mq_send_wait_prio(), causing it to return immediately when the queue is full instead of blocking as required by POSIX.1-2017. This patch: 1. Changes mq_send() to use RT_WAITING_FOREVER for blocking behavior 2. Implements mq_timedsend() properly with timeout support 3. Fixes errno mapping for different error conditions Reference: POSIX.1-2017 mq_send(3p): "If the specified message queue is full, mq_send() shall block until space becomes available to enqueue the message, or until mq_send() is interrupted by a signal." Fixes: https://github.com/RT-Thread/rt-thread/issues/11196 Signed-off-by: hzt <[email protected]>
2026-01-31[components][clock_time] Refactor time subsystem around clock_time (#11111)Bernard Xiong
* [components][clock_time] Refactor time subsystem around clock_time Introduce the clock_time core with clock source/event separation, high-resolution scheduling, and boot-time helpers, plus clock_timer adapters for timer peripherals. Remove legacy ktime/cputime/hwtimer implementations and migrate arch and BSP time paths to the new subsystem while keeping POSIX time integration functional. Update drivers, Kconfig/SConscript wiring, documentation, and tests; add clock_time overview docs and align naming to clock_boottime/clock_hrtimer/clock_timer. * [components][clock_time] Use BSP-provided clock timer frequency on riscv64 * [risc-v] Use runtime clock timer frequency for tick and delays * [bsp] Add clock timer frequency hooks for riscv64 boards * [bsp] Update Renesas RA driver doc clock_timer link * [bsp] Sync zynqmp-r5-axu4ev rtconfig after config refresh * [bsp][rk3500] Update rk3500 clock configuration * [bsp][hpmicro] Add rt_hw_us_delay hook and update board delays * [bsp][stm32l496-st-nucleo] enable clock_time for hwtimer sample in ci * [bsp][hpmicro] Fix rtconfig include scope for hpm6750evk Move rtconfig.h include outside the ENET_MULTIPLE_PORT guard for hpm6750evk and hpm6750evk2 so configuration macros are available regardless of ENET settings. * [bsp][raspi3] select clock time for systimer * [bsp][hpm5300evk] Trim trailing blank line * [bsp][hpm5301evklite] Trim trailing blank line * [bsp][hpm5e00evk] Trim trailing blank line * [bsp][hpm6200evk] Trim trailing blank line * [bsp][hpm6300evk] Trim trailing blank line * [bsp][hpm6750evk] Trim trailing blank line * [bsp][hpm6750evk2] Trim trailing blank line * [bsp][hpm6750evkmini] Trim trailing blank line * [bsp][hpm6800evk] Trim trailing blank line * [bsp][hpm6e00evk] Trim trailing blank line * [bsp][nxp] switch lpc178x to gcc and remove mcx timer source * [bsp][stm32] fix the CONFIG_RT_USING_CLOCK_TIME issue. * [docs][clock_time] add clock time documentation * [docs][clock_time] Update clock time subsystem documentation - Update device driver index to use correct page reference - Clarify upper layer responsibilities in architecture overview - Update README to describe POSIX/libc, Soft RTC, and device driver usage - Refine architecture diagram with improved layout and color scheme - Remove obsolete clock_timer.md file * [kernel][utest] Trim trailing space * [clock_time] Fix hrtimer wrap handling * [clock_time] fix the static rt_inline issue * [clock_time] fix the rt_clock_hrtimer_control result issue
2025-12-18[components][libc][posix][libdl] Optimization: Redundant calculations in a ↵laidene
for loop
2025-12-02[LIBC/AIO] Set the AIO work stack size default.GuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-11-16Reorganize Group names in build system for clarity and IDE integration #10923Copilot
2025-10-13fix(stdio): ensure compatibility with newlib <3.4.0 by handling removed ↵loremmoqi
__sdidinit (#10791)
2025-09-24RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead ↵Yonggang Luo
int/rt_int32_t
2025-09-24Trim trailing spaces of components/libc/posix/io/poll/poll.cYonggang Luo
Signed-off-by: Yonggang Luo <[email protected]>
2025-07-25[pthreads] Fix pthread_cond_timedwait lacks timeout wakeupChenRuiwei
2025-07-24[components/libc] add comments for some pthread functions. #10423Codeman-1999
2025-03-11fix dangling pointer in component pthread and dfs_elm (#9976)lingfengPeng
* [components/libc/posix][pthreads]fix the risk of dangling pointer * [components][dfs][dfs_elm]:fix risk of dangling pointer, unmount the temp driver then free the temp FATFS in dfs_elm_mkfs.
2025-02-22components: libc: fix pointer-to-integer cast warnings and address truncationkenneth.liu
[Problem Description] 1. When enabling RT_USING_MODULE=y, compilation warnings occur: dlelf.c:386:27: warning: cast from pointer to integer of different size dlelf.c:398:25: warning: cast from pointer to integer of different size dlelf.c:408:24: warning: cast from pointer to integer of different size 2. On RV64 architectures (e.g. Sophgo SG2042 with RISC-V Sv39 and 40-bit physical addressing), dlsym may fail when accessing addresses beyond 32-bit range. [Root Cause] In dlmodule_load_relocated_object() and dlmodule_symbol_find(), pointer is cast to rt_uint32_t which truncates: | rt_ubase_t rodata_addr = (rt_uint32_t)ptr; This causes: - Warnings on 64-bit systems (pointer width > 32-bit) - Actual address truncation on RV64 when physical address exceeds 32-bit [Solution] Replace rt_uint32_t with architecture-adaptive rt_ubase_t: | rt_ubase_t rodata_addr = (rt_ubase_t)ptr; The rt_ubase_t is defined in include/rttypes.h as: | #ifdef ARCH_CPU_64BIT | typedef rt_uint64_t rt_ubase_t; | #else | typedef rt_uint32_t rt_ubase_t; | #endif This ensures correct width casting for both 32/64-bit architectures. Signed-off-by: Liu Gui <[email protected]>
2025-02-20components: libc: fix array overflow in rt_object name assignmentkenneth.liu
[Problem Description] When assigning name to rt_object, strncpy() uses size equal to RT_NAME_MAX, which causes missing null-terminator and overflows into adjacent 'type' field. This corruption leads to unexpected system behavior. [Problem Analysis] The rt_object structure defines: | char name[RT_NAME_MAX] | -> buffer | rt_uint8_t type | -> adjacent field Original code calculates size as: size = end - first + 1; if (size > RT_NAME_MAX) size = RT_NAME_MAX; When size equals RT_NAME_MAX, strncpy() will copy exactly RT_NAME_MAX bytes without adding terminating '\0', causing two issues: 1. name buffer is not null-terminated 2. The implicit null-byte writes beyond name[] into type field [Solution] Change boundary check from: if (size > RT_NAME_MAX) size = RT_NAME_MAX; to: if (size >= RT_NAME_MAX) size = RT_NAME_MAX - 1; This ensures: 1. Always leaves space for null-terminator 2. Prevents overflow into type field 3. Maintains maximum valid name length (RT_NAME_MAX-1 + '\0') Signed-off-by: Liu Gui <[email protected]>
2024-12-18[components][libc/io]add comments for timer fd APIs.ligr
2024-11-21[components/libc/posix]add comments for thread local storage APIs.ligr
2024-11-21[components/libc/posix]fix the problem that it doesn't check if barrier ↵ligr
still in use and dosen't destory the mutex either.
2024-11-21[components/libc/posix]fix the errors that assigning an integer to a pointer ↵ligr
and always return EINVAL.
2024-11-21[components/libc/posix]add comments for barrier APIs.ligr
2024-11-19[components/libc/posix]add comments for rwlock APIs.ligr
2024-11-19[components/libc/posix]add comments for condition variable APIs.ligr
2024-11-18[components/libc/posix]add comments for mutex APIs.ligr
2024-11-16[components/libc/posix][pthreads]add comments for thread APIs of pthread.ligr
2024-11-13[libc] add comments for libdl APIs.ligr
2024-08-25修复TLS内存申请没有初始化问题zx568073531
2024-08-25修复TLS申请内存后没有初始化问题SeliverWang
2024-06-26fix Compilation error in "driver.c", "completion_up.c", "syslog.c" and ↵Rui
"dlmodule.c". (#9093)
2024-06-20除了bsp之外的Kconfig使用rsource替代sourcelatercomer
2024-06-16[bsp/phytium]c++支持,gpio,qspi驱动修改 (#9059)zhangyan
* GPIO驱动与QSPI驱动适配 * C++支持 * update --------- Co-authored-by: 张衍 <[email protected]>
2024-05-11修复C++11 ↵atwww
thread_local对象析构函数与实际内存释放动作顺序相反问题
2024-05-01[kernel] add rt_thread_close()Shell
* [thread] Add rt_thread_close() This patch introduces a new function `rt_thread_close()` to enhances the usability and maintainability by providing a dedicated mechanism for closing threads. - A new function `rt_thread_close()` is added to the API, providing a standardized approach for closing threads. - The `rt_thread_close()` function removes a thread from the thread queue, updates its status to indicate closure, and performs the thread timer detaching which is a embedded timer in thread object. - Additionally, the `rt_thread_detach()` function is modified to utilize `rt_thread_close()` internally, streamlining the thread detachment process. Signed-off-by: Shell <[email protected]>
2024-04-30Add comments for all functions in components/libc/posix/ipc/mqueue.cTroy
2024-04-26Add comments for all functions in components/libc/posix/io/termios/termios.cTroy
2024-04-24Add some comments in components/libc/posix/ipc/semaphore.c (#8848)Troy
2024-04-15修复POSIX线程本地存储寻找posix线程句柄时的逻辑错误 (#8790)atwww
* Add GCC generalized atomic operation function * 修复POSIX线程本地存储寻找posix线程句柄时的逻辑错误
2024-04-09[libc] add some posix function commentsTroy
2024-04-01[libc][posix/io] add commentsTroy
2024-03-28Add comments for all functions in components/libc/posix/io/eventfd/eventfd.cTroy
2024-03-28sync smart & dfs (#8672)Shell
Signed-off-by: xqyjlj <[email protected]> Signed-off-by: Shell <[email protected]> Co-authored-by: xqyjlj <[email protected]>
2024-03-27Fix the issue of incorrect return of invalid parameters in aio_writeTroy
2024-03-26Fix epoll.c file format errorTroy
2024-03-26Fix incorrect naming of triggeredTroy
2024-03-26modified: components/libc/posix/io/aio/aio.c Added some function commentsTroy
modified: components/libc/posix/io/aio/aio.h Align comments within the aiocb structure modified: components/libc/posix/io/epoll/epoll.c Add comments for all functions and members within structure members
2024-03-25modified: components/libc/posix/delay/delay.c Added comments for all ↵Troy
functions in this file modified: components/libc/posix/signal/posix_signal.c Add comments to the sigqueue function, although it does not have an internal implementation modified: components/libc/posix/signal/posix_signal.h Added detailed explanation to all members of the rt_signal_value enumeration
2024-02-23🎯 Sync smart & scheduler codes (#8537)Shell
Signed-off-by: Shell <[email protected]> Co-authored-by: xqyjlj <[email protected]>