Commit Graph

15 Commits

Author SHA1 Message Date
Aaron Nyholm
0e20f50870 testsuites/fstests/fsclose01: Fix expected flags
close() now holds a reference to the IOP this changes the
expected flags in the test. This change reflects that.
Updates #5311
2025-11-05 19:50:46 +00:00
Joel Sherrill
89efbdda7c testsuites/fstests/*: Address unused parameter warnings
Add "(void) param;" annotation to address unused parameter warnings.
    Found with GCC's warning -Wunused-paramter.
2025-10-08 16:48:32 +00:00
Chris Johns
df1d85c0f8 cpukit/libio: Support close with IOP references held
- Provide an option for a file system to support close wtih
  references held. This can happen in more complex file systems
  and file descriptor handling with more complete reference
  handling implementations where an fd can hold other fds and
  close can be call on any fd and succeed.

- Fix open IOP leaks in the error paths.

- Provide better definition of the IOP flags to help clarify
  the code.

Fixes #5201
2025-06-26 00:53:51 +00:00
Sebastian Huber
bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Sebastian Huber
c2287ba2cf libio: Robust file descriptor reference counting
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-13 09:57:04 +01:00
Sebastian Huber
3cec2dfbc4 config: CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
Rename CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS into
CONFIGURE_MAXIMUM_FILE_DESCRIPTORS.

Update #3753.
2019-12-19 08:53:03 +01:00
Sebastian Huber
47b32a01a4 fsclose01: Fix uninitialized variable warning 2018-10-12 14:45:24 +02:00
Sebastian Huber
a3eec5cf35 fsclose01: Fix task mode, use attribute
Update #1971.
2018-02-09 13:17:45 +01:00
Sebastian Huber
48aa4b5d50 fsclose01: Use floating-point task
The tmpfile() uses sprintf().

Update #1971.
2018-02-09 13:14:52 +01:00
Sebastian Huber
4ac5ffbb83 fsclose01: Add tmpfile() test case
Close #1971.
2018-02-05 09:31:32 +01:00
Sebastian Huber
c4b8b147dd tests: Use simple console driver
Update #3170.
Update #3199.
2017-11-06 07:26:42 +01:00
Sebastian Huber
af4355459e tests: Remove TEST_INIT
The TEST_EXTERN is a used only by the system.h style tests and they use
CONFIGURE_INIT appropriately.

Update #3170.
Update #3199.
2017-10-28 13:33:56 +02:00
Chris Johns
98c6d50145 testsuite: Use printk for all test output where possible.
- Remove the printf support leaving the direct printk support configured
  with TESTS_USE_PRINTK and all other output goes via a buffered vsniprintf
  call to printk.
- Control the test's single init for functions and global data with
  TEST_INIT and not CONFIGURE_INIT. They are now separate.

Updates #3170.
2017-10-23 16:25:45 +11:00
Sebastian Huber
ac741625b0 libio: Use FIFO for iop free list
Update #3136.
2017-09-15 10:55:38 +02:00
Sebastian Huber
baef823cd5 libio: Add hold/drop iop reference
Check iop reference count in close() and return -1 with errno set to
EBUSY in case the file descriptor is still in use.

Update #3132.
2017-09-15 10:29:34 +02:00