void print_all(FILE *stream)
while ((c = getc(stream)) != EOF)
/* call netstat command. netstat is available for Windows and Linux */
if ((stream = popen("netstat", "r")) == NULL)
This program runs a process (
popen() and reads all the standard output from the process and echoes that to standard output.
popen() does not exist in the standard C library, but it is rather a part of POSIX C)