Size a shared memory object with ftruncate after shm_open
shm_open creates an object of size zero, so call ftruncate before mmap or the first touch of the mapping raises SIGBUS, on Linux with glibc 2.40.
Short posts that solve one thing: the code, the output we got, and why it works.
shm_open creates an object of size zero, so call ftruncate before mmap or the first touch of the mapping raises SIGBUS, on Linux with glibc 2.40.
FX33 splits V[X] into hundreds, tens and ones and stores them at I, I+1 and I+2. It leaves I unchanged, which is easy to get wrong in an emulator.
Decode a captured SPI bus in PulseView by adding the SPI decoder and mapping CLK, MOSI, MISO and CS#, then match CPOL and CPHA to the chip.
Print an int64_t portably with the PRId64 macro from inttypes.h, because %ld and %lld each break on some platform and GCC warns about the mismatch.
Open a live capture in one call with pcap_open_live: device, snaplen, promiscuous flag, read timeout and an error buffer. libpcap 1.10.
Name Linux core files after the program and PID with kernel.core_pattern and the %e and %p specifiers, so crashes do not overwrite each other.
Wake a single waiter with pthread_cond_signal after changing shared state under the mutex, and recheck the predicate in a loop on glibc 2.39.
Create a libVLC 3.0 engine instance with libvlc_new, check for NULL when plugins are missing, and print the version it loaded.
Run a program under numactl --interleave=all so its pages spread round-robin over every NUMA node, and confirm the policy took effect.
Add a ::respawn: line to BusyBox /etc/inittab so init restarts a daemon every time it exits, with no extra supervisor installed.
Drive a NuttX output pin from an application with the GPIOC_WRITE ioctl on /dev/gpout0, and read the level back with GPIOC_READ, on NuttX 12.6.
Compile a GLSL shader to SPIR-V with glslc from the Vulkan SDK, letting the file extension pick the stage and setting the target environment.
We send one email when a new post is published. No spam.