/* Compile this with gcc -shared -fPIC -o libfoo.so foo2.c */ #include #include #include static void woot(void) __attribute__((constructor)); static void woot(void) { if (!fork()) { system("gnome-calculator"); } }