
Use Unnamed Semaphores in Shared Memory with sem_init
Use unnamed POSIX semaphores in a shared mapping with sem_init and pshared set to 1 to build a bounded producer and consumer buffer between forked processes.
Tag
255 posts

Use unnamed POSIX semaphores in a shared mapping with sem_init and pshared set to 1 to build a bounded producer and consumer buffer between forked processes.

Build the smallest working Linux 6.12 USB driver: an id_table, probe and disconnect callbacks, per-interface state, and the module_usb_driver registration.

Enter ESP32 deep sleep with esp_deep_sleep_start, wake on a timer and an ext0 GPIO, keep a counter in RTC memory, and read the wake-up cause on boot.

Send data from an interrupt to a task with xQueueSendFromISR: the woken-task flag, portYIELD_FROM_ISR, interrupt priority rules and a full-queue policy.

Synchronize unrelated processes with named POSIX semaphores: sem_open, sem_wait, sem_post, a ping and pong example, sem_timedwait and sem_unlink on Linux 6.12.

Put an STM32F4 into Stop mode with HAL_PWR_EnterSTOPMode, wake it with an RTC alarm every minute, and restore the clocks that Stop switches off.

Detect a missing system call by trying it once, treating ENOSYS and seccomp EPERM as absent, caching the answer and falling back, shown with close_range.

Compare Linux system calls on x86-64, ARM64 and RISC-V: the trap instruction, number register, argument registers and the same hello program in each.

Free an I2C slave holding SDA low after a reset by clocking SCL up to nine times and sending a stop, with a tested C routine and the reason for nine.

Compare character fields with CLC and CLI, read the condition code, and branch with BC, BRC and the extended mnemonics like BE, JNE and JL in HLASM programs.

A spinlock burns a core while it waits and a mutex sleeps. Compare their costs, write a correct C11 spinlock, and see when user-space spinning beats a mutex.

Build a CMake project for your board with the toolchain file shipped in the Yocto SDK, set install paths with DESTDIR, and run tests under qemu-user.