summaryrefslogtreecommitdiff
path: root/components/libc/posix
AgeCommit message (Collapse)Author
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]>
2024-01-26[sys_bind] [signalfd] update (#8507)rcitachi
2023-12-21Update epoll and timerfd (#8330)zmq810150896
2023-12-21[libc][Kconfig] default open epoll/eventfd/signalfd/timerfd/select (#8386)zmq810150896
2023-12-10update libc (#8335)geniusgogo
2023-12-06Updated issues related to uds capacity and eventfd macro redefinition (#8329)zmq810150896
2023-11-28[SAL] Update SAL,Add socketpair sendmsg recvmsg function (#8293)rcitachi
2023-10-25🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)xqyjlj
Signed-off-by: Shell <[email protected]> Co-authored-by: Shell <[email protected]>
2023-10-17Sync dfs lwp (#8123)geniusgogo
2023-10-13Fixed issues with timerfd (#8102)zmq810150896
2023-09-23Add the system call timerfd and update SConscript for signalfd (#8067)zmq810150896
2023-09-20Adapt rt_channel, increase the generality of some rt_channel functionality ↵zmq810150896
on dfs v2, and standardize signalfd (#8047)