Skip to content

Instantly share code, notes, and snippets.

@richo
Created February 11, 2014 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richo/8926816 to your computer and use it in GitHub Desktop.
Save richo/8926816 to your computer and use it in GitHub Desktop.
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
void dump_usage(struct rusage); // Left as an excercise to reader
int main(int argc, char** argv) {
pid_t pid;
struct rusage usage;
int loc;
if (pid = fork()) {
wait4(pid, &loc, 0, &usage);
dump_usage(usage);
} else {
argv[0] = "sass";
execvp("/path/to/sass", argv);
}
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment