I was recently reviewing some code introduced usage of POSIX message queues into some tests. I hadn't used them before, and nothing in the code base already used them, so I needed to familiarize myself with them a bit.
One annoyance of working with POSIX message queues on Linux is that there doesn't seem to be a ubiquitous command-line tool for manipulating them. Their predecessor, sys v message queues, have ipcmk
read more
Interposing internal libc calls
Calls within libc are generally pre-linked. As a result, they can't be interposed using LD_PRELOAD
. This makes it tricky to use LD_PRELOAD
to intercept, e.g., all calls to write
, but there are some workarounds.
Doubling all writes to standard output¶
Suppose we want to use LD_PRELOAD
to force any output to stdout
read more
Patching glibc to make its syscalls interposable
Suppose we have a program, call_write.c, that writes some strings to stdout:
$ cat ./call_write.c
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
const char* msg = "syscall\n";
syscall(SYS_write, STDOUT_FILENO, msg, strlen(msg));
msg = "write …
Guinea Pig Guinea Pig
Guinea Pig Guinea Pig is an HTML5 game made for the 2013 Global Game Jam. You play a (further) miniaturized, super-powered, Guinea Pig. Your job is to weaken (with your eye-lasers, of course) and collect the germs infecting the patient's arteries, while contending with the rhythmic blood flow.
Made with …
read moreDance Ave
I got an interesting request a few months ago--to implement the telephony back-end for a real life dancing game to be played at the 2013 Three Rivers Arts Festival.
Dance Ave is a physical game where players try to reach all of several stations positioned around an area. Players may …
read moreIn-Repository Documentation
Introduction
Two popular places to keep documentation for programming projects are:
- In
README
files in the code repository. - In a separate wiki.
In this article, I propose that a compelling way to manage documentation is to combine the two: to write the documentation as markdown files in the code repository …
read more