#define _GNU_SOURCE 1 #include #include #include #include #include pid_t getpid(void) { pid_t (*orig_getpid)(void) = (pid_t(*)(void))dlsym(RTLD_NEXT, "getpid"); printf("Calling GETPID\n"); return orig_getpid(); }