Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Adds support for POSIX interface open_memstream() that allows writing
to dynamic memory buffer stream. The stream is dynamically reallocated
as the buffer grows with initial size set to zero.
The caller has to free the buffer after the stream is closed.
The implementation uses fopencookie() for custom stream operations and
callbacks.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Add support for POSIX interface fmemopen(). This interface open a memory
buffer as a stream and permits access to this buffer specified by mode.
This allows I/O operations to be performed on the memory buffer.
The implementation uses fopencookie() for custom stream operations and
callbacks.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit adds support for custom stream via fopencookie function.
The function allows the programmer the create his own custom stream
for IO operations and hook his custom functions to it.
This is a non POSIX interface defined in Standard C library and implemented
according to it. The only difference is in usage of off_t instead of
off64_t. Programmer can use 64 bits offset if CONFIG_FS_LARGEFILE is
enabled. In that case off_t is defined as int64_t (int32_t otherwise).
Field fs_fd is removed from file_struct and fs_cookie is used instead
as a shared variable for file descriptor or user defined cookie.
The interface will be useful for future fmemopen implementation.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
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>
The setbuffer() function is a wrapper around setvbuf() which
enables full buffering on a buffer allocated by the caller, assuming
buffer is not a null pointer.
Use lib_get_stream() to fetch stdin/stdout/stderr,
since is more easy to works with other language by function call
than export native C structure memory layout.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This is preparation for flushing streams from user space, like it should
be done.
- Move tg_streamlist (group, kernel space) ->
ta_streamlist (TLS, user space)
- Access stream list via tg_info in kernel
- Access stream list via TLS in user space
- Remove / rename nxsched_get_streams -> lib_getstreams
- Remove system call for nxsched_get_streams
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
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>
Author: Gregory Nutt <gnutt@nuttx.org>
TODO: Remove 'Missing fscanf()' bug
Clean up remaining complaints for tools/nxstyle
Apply tools/detab, rmcr, convert-comments, lowhex, and indent.sh to the new and highly modified files.
Author: Johannes <nivus.entwicklung@gmail.com>
- Move vscanf logic to lib_sscanf.c Switched to stream interface (tricky, because the old implementation used massive read ahead, which isn't suitable for streams, chars already read are gone).
- Added scanf and fscanf
- Added hh, h, and ll modifiers
- Fixes for standard compliance in scanf
- Fixes for standard compliance in strto... function family (don't consume single '-' or '+', allow sign in strotul(l))