|Did you know that popen wasn't thread safe?
Yeah well it ain't. So those nice little 3 liners (popen, fgets, pclose) now turn into a pipe, fork, dup, close, exec, waitpid, hndstate mess. Of course put it in a function and forget about it.
But why? Why not fix the function! It's not the '90s anymore people, where Linux is just for uni students with too much time on their hands.
Btw gdb 6.0 is out. And it fails nicely when you call fork in a program linked to pthreads (not even calling pthreads yet). However with gdb 5.3 you can call fork, exec etc and it all works but popen is still poison.
So now I have the joy of hunting through LGI and removing all calls to popen so that things "Just Work (tm)".