Files
rtems/cpukit/libcsupport/src
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
..
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2020-04-16 07:30:00 +02:00
2020-04-16 07:30:00 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2022-05-04 09:12:07 -05:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-10-13 19:02:15 -05:00
2023-10-13 19:02:15 -05:00
2023-05-20 11:05:26 +02:00
2023-10-13 19:02:15 -05:00
2020-04-16 07:30:00 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2021-09-20 13:31:25 -05:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2014-10-24 16:05:59 -07:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-05-20 11:05:26 +02:00
2023-07-28 11:58:32 +02:00

libcsupport

Overview of newlib support (newlib is from CYGNUS) Each task can have its own libc state including: open stdio files strtok multi precision arithmetic state etc.

This is implemented by a reentrancy data structure for each task.

When a task is "started" (in RTEMS sense) the reentrancy structure
is allocated.

When task is switched to, the value of global variable _impure_ptr
is changed to the value of the new tasks reentrancy structure.

When a task is deleted
    atexit() processing (for that task) happens
    task's stdio buffers are flushed

When exit(3) is called
    calling task's atexit processing done
    global libc state atexit processing done
        (this will include any atexit routines installed by drivers)
    executive is shutdown
        causes a context switch back to bsp land

NOTE: libc extension are installed by bsp_libc_init() iff we are using clock interrupts. This hack is necessary to allow the tmtests to avoid timing the extensions.

Cases

This is a list of cases to consider when implementing a file system:

+ Given a tree of this form:

        a ----- b
               /
             c

Where a and b are directories and c is a link to directory b. Consider this sequence:

- rmdir a/b
- mknod c/b/x
- unlink c

TODO

  • newlib 1.8.0 has the wrong prototype for at least read() and write().

  • There should be a "eat it" stub for all system calls which are available to make filling out an operations table easier.
    See device_lseek() for an example of where this would be nice.

  • Fix strerror() so it prints all error numbers.

  • Check the node allocation coment in the fchdir call.

  • Add an interface somewhere for this call.