uint32_t upper_idx = idx;
int rc = dir->upper->i_ops->readdir(dir->upper, &upper_idx, ents, buf_len);
if (rc > 0) {
- written = (uint32_t)rc / (uint32_t)sizeof(struct vfs_dirent);
*inout_index = upper_idx;
return rc;
}
if (current_process) {
memcpy(proc->fpu_state, current_process->fpu_state, FPU_STATE_SIZE);
- } else {
- arch_fpu_init_state(proc->fpu_state);
- }
- /* POSIX: fork inherits signal handlers and blocked/pending masks.
- * Pending signals are cleared in the child (POSIX spec). */
- if (current_process) {
+ /* POSIX: fork inherits signal handlers and blocked/pending masks.
+ * Pending signals are cleared in the child (POSIX spec). */
for (int i = 0; i < PROCESS_MAX_SIG; i++) {
proc->sigactions[i] = current_process->sigactions[i];
}
proc->sig_blocked_mask = current_process->sig_blocked_mask;
/* sig_pending_mask stays 0 (memset) — POSIX: pending signals are not inherited */
+ } else {
+ arch_fpu_init_state(proc->fpu_state);
}
/* Copy parent's file descriptors under sched_lock so the child
if (!current_process) return -EINVAL;
uintptr_t src_as = hal_cpu_get_address_space() & ~(uintptr_t)0xFFFU;
- if (current_process->addr_space != src_as) {
- current_process->addr_space = src_as;
- }
+ current_process->addr_space = src_as;
uintptr_t child_as = vmm_as_clone_user_cow(src_as);
if (!child_as) return -ENOMEM;
uint8_t e_ident[16];
uint16_t e_type;
uint16_t e_machine;
- uint32_t e_version;
- uint32_t e_entry;
- uint32_t e_phoff;
- uint32_t e_shoff;
- uint32_t e_flags;
- uint16_t e_ehsize;
+ uint32_t e_version; // cppcheck-suppress unusedStructMember [needed for sizeof/layout]
+ uint32_t e_entry; // cppcheck-suppress unusedStructMember
+ uint32_t e_phoff; // cppcheck-suppress unusedStructMember
+ uint32_t e_shoff; // cppcheck-suppress unusedStructMember
+ uint32_t e_flags; // cppcheck-suppress unusedStructMember
+ uint16_t e_ehsize; // cppcheck-suppress unusedStructMember
uint16_t e_phentsize;
uint16_t e_phnum;
- uint16_t e_shentsize;
- uint16_t e_shnum;
- uint16_t e_shstrndx;
+ uint16_t e_shentsize; // cppcheck-suppress unusedStructMember
+ uint16_t e_shnum; // cppcheck-suppress unusedStructMember
+ uint16_t e_shstrndx; // cppcheck-suppress unusedStructMember
} test_elf32_ehdr_t;
typedef struct {