|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Root-confined hosted POSIX adapter for fw_if_fs. More...
Go to the source code of this file.
Data Structures | |
| struct | fw_fs_posix_cfg_t |
| POSIX composition-root settings. More... | |
| struct | fw_fs_posix_state_t |
| Caller-owned POSIX adapter state. More... | |
Functions | |
| ra8_err_t | fw_fs_posix_init (fw_fs_t *out, fw_fs_posix_state_t *state, const fw_fs_posix_cfg_t *cfg) |
| Open/configure a root-confined POSIX binding. | |
| ra8_err_t | fw_fs_posix_deinit (fw_fs_posix_state_t *state) |
| Close the root descriptor; no bound operation is valid afterward. | |
Root-confined hosted POSIX adapter for fw_if_fs.
The adapter opens one caller-selected directory and resolves every portable path relative to that descriptor. Intermediate components and final file opens use no-follow semantics, so neither .. nor a symlink can escape the bound root. The adapter itself calls no allocator. File streams use raw descriptors and Linux/macOS directory enumeration uses a bounded local kernel-record buffer rather than an opaque C-runtime directory stream. A different hosted kernel is rejected at compile time until its raw directory ABI has a validated decoder; the adapter never falls back to an allocator-backed DIR implementation.
Definition in file fw_if_fs_posix.h.
|
nodiscard |
Close the root descriptor; no bound operation is valid afterward.
Definition at line 530 of file fw_if_fs_posix_bind.c.
References fw_fs_posix_state_t::initialized, internal_state_reset(), k_ra8_err_not_initialized, k_ra8_err_null_ptr, priv_fs_posix_close_fd(), and fw_fs_posix_state_t::root_fd.
Referenced by fw_fs_posix_init(), internal_main_run(), internal_storage_init(), and priv_alphabet_soup_load_file_contents().
|
nodiscard |
Open/configure a root-confined POSIX binding.
A failed attempt leaves an inactive state with root descriptor -1 and cleared cached inputs. A duplicate attempt against an already initialized state returns k_ra8_err_exists without changing it.
Definition at line 493 of file fw_if_fs_posix_bind.c.
References fw_fs_posix_state_t::atomic_noreplace, fw_fs_posix_deinit(), fw_fs_posix_state_t::initialized, internal_atomic_noreplace_available(), internal_caps(), internal_root_open(), internal_state_reset(), k_ra8_err_exists, k_ra8_err_null_ptr, k_ra8_ok, priv_fs_posix_bind_interfaces(), fw_fs_posix_cfg_t::removable_media, fw_fs_posix_state_t::removable_media, fw_fs_posix_state_t::root_fd, fw_fs_posix_cfg_t::root_path, and fw_fs_posix_state_t::transaction_id.
Referenced by internal_storage_init(), and priv_alphabet_soup_load_file_contents().