#include <__stdio.h> // for __FILE #include // for fclose, FILE, pclose #include // for waitpid int pclose(FILE *stream) { int stat; fclose(stream); return (waitpid(stream->pid, &stat, 0) < 0) ? -1 : stat; }