Skip to content

Instantly share code, notes, and snippets.

View stefanalt's full-sized avatar

Stefan Althöfer stefanalt

View GitHub Profile
@stefanalt
stefanalt / rbuflog.c
Last active December 31, 2022 06:00
log STDIN to in-memory ring-buffer, print buffer content on pipe close or signal
/*
* rbuflog.c - log STDIN to in-memory ring-buffer, print on pipe close or signal
*
* See usage() for details;
*/
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>