Implement the bzero function as an alternative to macro expansion.
and support gcc FORTIFY_SOURCE features for nuttx libc
This function will use gcc's function
__builtin_dynamic_object_size and __builtin_object_size
Its function is to obtain the size of the object through compilation,
so as to judge whether there are out-of-bounds operations in commonly used functions.
It should be noted that the option -O2 and above is required to enable this function
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In the gcc-riscv compiler, __builtin_ffs will call ffs, and calling __builtin_ffs in ffs will cause recursion
Change ffs to an inline function, and compile ffs implemented by nuttx by default.
Only call the implementation of nuttx when the compiler cannot provide an ffs implementation.
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This function will use gcc's function
__builtin_dynamic_object_size and __builtin_object_size
Its function is to obtain the size of the object through compilation,
so as to judge whether there are out-of-bounds operations in commonly used functions.
It should be noted that the option -O2 and above is required to enable this function
Signed-off-by: anjiahao <1090959677@qq.com>
since it's useful to redirect these functions to others
sometime(e.g. validate the memory before write).
Change-Id: I6253a9231af8809e8362f4bc5a1bd67fb094c3b0
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
* Simplify EINTR/ECANCEL error handling
1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx
* Unify the void cast usage
1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro