Created
February 11, 2014 00:05
-
-
Save richo/8926816 to your computer and use it in GitHub Desktop.
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 <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