#include #include #include #include #include void foo(void) __attribute__ ((constructor)); void foo(void) { /* Removing this call to getpid() removes the bug */ getpid(); } int main(void){ int i=syscall(SYS_fork); if (0==i) /* Big problem: the son prints the same value for getpid() and getppid() */ printf("__son : %d father : %d__\n", getpid(), getppid()); else printf("<>\n", getpid(), i); return 0; }