summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-06-09futimens.c, utime.c: Remove unnecessary include of <sys/stat.h>.Joel Sherrill2-2/+0
2021-05-28Change filesystem utime_h handler to utimens_hRyan Long3-13/+30
Also updated licenses. Closes #4400 Updates #3899
2021-05-28libcsupport: Implement utimes() in terms of utimensat()Ryan Long1-14/+49
utimes() now calls utimensat() to update file access and modification timestamps. Updated license. Closes #4398
2021-05-28libcsupport: Implement utime() in terms of utimensat()Ryan Long1-32/+40
utime() now calls utimensat() to update file access and modification timestamps. Updated license. Closes #4397
2021-05-28libcsupport: Added futimens() and utimensat()Ryan Long2-0/+312
Created futimens.c and utimensat.c to add support for the POSIX methods futimens() and utimensat(). utime() and utimes() are considered obsolote by POSIX, but RTEMS will continue to support them. Closes #4396
2021-05-25sysinit: Do not open console when just referencing reentrancy structure.Joel Sherrill1-6/+0
This change eliminates a system initialization dependentcy which resulted in an application without a file system or console referencing errno being forced to include the code to open(/dev/console), close(), atexit(), and the unmount infrastructure. Closes #4439.
2021-05-07Check the alignment in posix_memalign() earlierSebastian Huber1-4/+4
Make sure all conditions to do a proper memory allocation are satisfied before a zero size memory allocation is performed. Update #4390.
2021-05-06Return NULL for zero size allocationsSebastian Huber7-8/+30
In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Return NULL on RTEMS to more likely catch the use of a zero size memory area by erroneous applications. Update #4390.
2021-05-06libc: Reimplement posix_memlign()Sebastian Huber1-7/+22
Move all error checks into posix_memalign() so that the returned memory pointer is set to NULL under all error conditions except memptr == NULL. Use parameter names of POSIX documentation.
2021-05-04Make zero size allocation result consistentSebastian Huber3-14/+4
The zero size allocations had no consistent behaviour in RTEMS. For example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 ) returned in p a unique pointer (or NULL if no memory is available). In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Use this approach for RTEMS as well throughout the memory allocation directives Close #4390.
2021-04-29pwdgrp.c: Removed unused variableRyan Long1-2/+0
The 'sc' variable was originally storing the return value of mkdir(). This was causing an issue, so it was changed to make it to where we ignored the return value with (void). The 'sc' variable was left in by mistake.
2021-04-20Fix calloc() behaviour in case of overflowSebastian Huber2-2/+20
The multiplication to calculate the length of the memory area to allocate may overflow. Return NULL in case of an overflow. Close #4389.
2021-04-20malloc: Hide RTEMS_Malloc_Sbrk_amountSebastian Huber1-1/+6
Move RTEMS_Malloc_Sbrk_amount to the only implementation file which uses it and make it private to hide implementation-details from an API header.
2021-04-20libcsupport: Move rtems_calloc()Sebastian Huber2-15/+57
Move rtems_calloc() since it only depends on rtems_malloc(). This may make it easier to customize the heap allocator. Change licence to BSD-2-Clause according to file history. Update #3053.
2021-04-20Remove superfluous <rtems/score/wkspace.h> includesSebastian Huber1-1/+0
2021-03-27pwdgrp.c: Change to simply ignore return value from mkdir(/etc)Joel Sherrill1-3/+1
At this point in time, /etc can be created in multiple ways. There is a discussion (#4354) that would define a mechanism for instantiating a base file system with some flexibility for the set of directories included. For now, this particular mkdir() call can fail because /etc could already have been created by at least an initial filesystem image, the shell, or libbsd. closes #4382.
2021-03-23pwdgrp.c: Remove _Assert. /etc may already existRyan Long1-1/+5
Removed the _Assert_unused_variable_equals macro due to /etc having already been created by the network stack initialization or an initial filesystem image. Closes #4282
2021-03-08pwdgrp.c: Fix Unchecked return value from library (CID #1255518)Ryan Long1-1/+5
CID 1255518: Unchecked return value from library in pwdgrp_init(). Closes #4282
2021-02-27getgrent.c, record-client.c: Add missing includes for assert.hVijay Kumar Banerjee1-0/+1
2021-02-26getgrent.c: Fix Unchecked return value error (CID #1459004)Ryan Long1-1/+3
CID 1459004: Unchecked return value in endgrent(). Closes #4261
2021-02-26printertask.c: Fix Unchecked return value (CID #1399710)Ryan Long1-3/+8
CID 1399710: Unchecked return value in printer_task(). CID 1472764: Unchecked return value in rtems_print_printer_task(). Closes #4258
2021-02-12consolesimpletask.c: Fix Two Unchecked Return Values (CID #1437625 and #1472765)Ryan Long1-2/+5
CID 1437625: Unchecked return value from call to rtems_task_create(). CID 1472765: Unchecked return value from call to rtems_task_start(). Closes #4237.
2021-02-10libcsupport: Add sbrk greedy support to consume all sbrk memoryChris Johns2-12/+70
- Move the heap sbrk code into a separate routnine. - Update heap and workspace greedy allocators to use the common sbrk greedy support. Closes #3982
2021-02-08libcsupport: Have greedy allocations use consume extended memoryChris Johns1-0/+13
- Call the heap extend handler until all memory has been requested. Closes #3982
2021-02-08libcsupport: Add no_regular_file_mknod as a mount option to the mount tableChris Johns1-5/+8
- Add the bool flag no_regular_file_mknod to the mount table so a file system can indicate creating regular files is not done by use the mknod handler. The file system will handle creating a file node in the open handler. - Note, the mount option is an enum which means there is only one exclusive option supported. As a result no encapsulation is provided and file systems need to set no_regular_file_mknod directly. Closes #4222
2020-10-01Decouple the C Program Heap initializationSebastian Huber2-44/+90
Before this patch RTEMS_Malloc_Initialize() had a fixed dependency on _Workspace_Area. Introduce _Workspace_Malloc_initializer to have this dependency only if CONFIGURE_UNIFIED_WORK_AREAS is defined by the application configuration.
2020-08-31config: Add zero file descriptor data structuresSebastian Huber1-0/+46
Fix linker errors in the minimum test program on some BSPs introduced by ced28f2cfcee6d32ad7bb72e16b235212eb2eaaf.
2020-08-04termios: Make rtems_termios_ttyMutex privateSebastian Huber2-2/+3
This mutex is used to maintain termios internal data structures.
2020-07-24malloc: Make deferred free support optionalSebastian Huber3-39/+46
Only include the deferred free support if free() is actually used by the application. The free() implementation in RTEMS supports that allocated memory is freed in interrupt context. Since the heap is protected by a mutex, the frees issued in interrupt context cannot immediately be freed to the heap, instead they are placed on a deferred free list. This list is emptied by the core allocation function rtems_heap_allocate_aligned_with_boundary(). This adds a dependency to free() in rtems_heap_allocate_aligned_with_boundary(). In order to better support applications which only allocate memory and never free it, this dependency should be avoided. Provide a weak default implementation of _Malloc_Process_deferred_frees() for rtems_heap_allocate_aligned_with_boundary(). In the free() module provide the strong implementation. Close #4032.
2020-06-30score: Add CPU_USE_LIBC_INIT_FINI_ARRAYKinsey Moore1-4/+1
This introduces the CPU_USE_LIBC_INIT_FINI_ARRAY define for use by CPU ports to determine which global constructor and destructor methods are used instead of placing architecture defines where they shouldn't be. Close #4018
2020-05-07termios: Replace rtems_termios_isig_status_codeSebastian Huber2-40/+12
Merge the rtems_termios_isig_status_code and rtems_termios_iproc_status_code enums into a single rtems_termios_iproc_status_code which is now a part of the API. Simplify rtems_termios_posix_isig_handler() to avoid unreachable code. Close #3800.
2020-04-28doxygen: Switch @brief and @ingroupSebastian Huber17-17/+34
This order change fixes the Latex documentation build via Doxygen.
2020-04-16Canonicalize config.h includeSebastian Huber185-232/+232
Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
2020-03-16rtems: Add rtems_put_char()Sebastian Huber2-6/+39
Update #3904.
2020-03-13libio: Robust file descriptor reference countingSebastian Huber5-14/+23
There was a race conditon in the reference counting of file descriptors during a close() operation. After the call to the close handler, the rtems_libio_free() function cleared the flags to zero. However, at this point in time there may still exist some holders of the file descriptor. With RTEMS_DEBUG enabled this could lead to failed assertions in rtems_libio_iop_drop(). Change the code to use only atomic read-modify-write operations on the rtems_libio_iop::flags.
2020-03-04console: Use IMFS_add_node() for simple task consSebastian Huber1-20/+50
Change license to BSD-2-Clause according to file history. Update #3053. Update #3894.
2020-03-04console: Use IMFS_add_node() for simple consoleSebastian Huber1-17/+38
Change license to BSD-2-Clause according to file history. Update #3053. Update #3894.
2020-02-25config: Add <rtems/confdefs/malloc.h>Sebastian Huber2-0/+69
Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file. Move the default configuration to library files so that application configurations do not include the definitions for the default case. Update #3053. Update #3875.
2020-02-25libio: Add POSIX user environment pointer to TCBSebastian Huber3-35/+58
The IO library used a POSIX key to store an optional POSIX user environment pointer. This pulled in the POSIX keys support in every application configuration. Add a user environment pointer to the thread control block (TCB) instead. Applications which do not need the POSIX user environment will just get an overhead of one pointer per thread. Close #3882.
2020-02-10termios: Fix input canonical modeSebastian Huber1-50/+33
Canonical input processing was broken by 667501a314ba75f80f1c13c6b43dd35d0a00efd1 as shown by test case termios09. Update #3800.
2020-02-04bsps: Rework work area initializationSebastian Huber1-16/+41
The work area initialization was done by the BSP through bsp_work_area_initialize(). This approach predated the system initialization through the system initialization linker set. The workspace and C program heap were unconditionally initialized. The aim is to support RTEMS application configurations which do not need the workspace and C program heap. In these configurations, the workspace and C prgram heap should not get initialized. Change all bsp_work_area_initialize() to implement _Memory_Get() instead. Move the dirty memory, sbrk(), per-CPU data, workspace, and malloc() heap initialization into separate system initialization steps. This makes it also easier to test the individual initialization steps. This change adds a dependency to _Heap_Extend() to all BSPs. This dependency will be removed in a follow up change. Update #3838.
2020-01-17posix_devctl - Add support for SOCKCLOSEJoel Sherrill1-1/+15
The FACE Technical Standard, Edition 3.0 and later require the definition of the subcommand SOCKCLOSE in <devctl.h>. Reference: ​https://www.opengroup.org/face closes #3856.
2019-12-16libcsupport: Update rtems_print printk handler to return the lengthChris Johns1-2/+1
2019-12-13rtems: Add and use rtems_object_get_local_node()Sebastian Huber4-7/+11
Update #3841.
2019-11-05kill: Fix warningSebastian Huber1-1/+1
Include right header file for kill().
2019-10-08termios: Add Capability to Generate SIGINTR and SIGQUITJoel Sherrill2-39/+225
This patch adds the ability for termios to send SIGINTR on receipt of VINTR and SIGQUIT for VKILL and return -1/EINTR from read() on a termios channel. Importantly, this patch does not alter the default behavior or force POSIX signal code in just because termios is used. The application must explicitly enable the POSIX behavior of generating a signal upon receipt of these characters. This is discussed in the POSIX standard: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html Closes #3800.
2019-03-14Remove superfluous <rtems/system.h> includesSebastian Huber5-5/+0
2019-01-10memalign: Add missing attributes to fix warningSebastian Huber1-1/+3
Update #3666.
2018-12-21Add aligned_alloc() and memalign()Sebastian Huber1-0/+41
Ensure that the C++17 aligned new operator works. Close #3666.
2018-11-14or1k: Support GCC 9Sebastian Huber1-1/+2
Close #3602.