Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- compile:
- gcc -O0 -g0 wine.c -o wine
- strip -s wine
- */
- #include <stdlib.h>
- #include <unistd.h>
- extern char ** environ;
- char * launchee = "/usr/bin/wine-unstable";
- int main(int argc, char ** argv) {
- argv[0] = launchee;
- execve(launchee, argv, environ);
- return 1;
- }
- // test:
- // $ strace -ttt -e trace=execve ./wine --version
- // 1408079894.401853 execve("./wine", ["./wine", "--version"], [/* 25 vars */]) = 0
- // 1408079894.403664 execve("/usr/bin/wine-unstable", ["/usr/bin/wine-unstable", "--version"], [/* 25 vars */]) = 0
- // 1408079894.406404 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2238, si_status=0, si_utime=0, si_stime=0} ---
- // wine-1.7.24
- // 1408079894.407723 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2239, si_status=0, si_utime=0, si_stime=0} ---
- // 1408079894.407855 +++ exited with 0 +++
- //
- // result: overhead is about 1-2 ms.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement