2008-12-31から1日間の記事一覧

getpid on libc

へんなことに気がついた。 #include <unistd.h> static const int REPEAT = 100; int main() { int i; for (i = 0; i < REPEAT; i++) { getpid(); getpgid(); } return 0; } % gcc -O0 -o test test.c % strace -c -egetpid,getpgid ./test Process 9039 detached % ti</unistd.h>…