This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <assert.h> | |
// Test program to ensure OS correctly returns full exit status in si_status member | |
// of siginfo_t in SIGCHLD handler, as required by POSIX. Linux fails, FreeBSD succeeds. | |
sig_atomic_t exit_status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/event.h> | |
#include <sys/time.h> | |
#include <sys/wait.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <unistd.h> | |
// Program to demonstrate kqueue bug on macOS (Sierra, possibly others). The |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <utility> | |
#include <regex> | |
#include <experimental/filesystem> | |
// Recursively replace shebang lines with correct interpreter paths according to regex rules | |
namespace fs = std::experimental::filesystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fast fixed-dividend divider generator in C++11 | |
// by Davin McCall <davmac@davmac.org> | |
// | |
// Division is a relatively very slow operation even on modern processors. This | |
// template (ffdiv) produces a divider that will divide any number up to a fixed | |
// limit by a fixed dividend, using a multiplication and shift operation. I | |
// measured this as more than twice as fast as using ordinary division. | |
// | |
// Compile with (for eg) "gcc -std=c++11". | |
// |