CYGWIN b20: Pipe problems (bug?)
Thu Dec 3 09:07:00 GMT 1998

This message has been checked for virusses.
No known virusses have been detected.


I've searched the archives, but couldnt find any match to the problem
i am experiencing, but please excuse me if this subject is well known.
I'm only a beginning user of the cygwin compiler and must say i'm very
impressed with it, I do however have a problem with compiling one of
my projects.

I have one project which generates some database files by reading in a
lot of source files through a pipe. The code works quite nicely on
Linux and HPUX but doesnt seem to work with cygnus.. Below is a small
example program which i think has the same problem. The only
differences are that this example just gets stuck (after 55 pipes)
while my code returns an "no more files" after a about 27 pipes and
that this program just uses cat while my app pipes the files through

Now this may ofcourse be a simple error made by me, if so I would like
to know how i am supposed to do it. But it seems like pipe forgets to
close one end of the pipe, causing the fd table to overflow.. or
something like that anyways.

Platform. Win95,  333Mhz PII with 64 MB RAM and 2 GB HD

I would appreciate any hints or tips you can give me!

Peter Eussen

/* pipe test */

#include <stdio.h>
#include <errno.h>

int main(void)
{   FILE *piped_file;
    char pipestr[512];
    int  i = 0;

    while (i < 512)
       sprintf(pipestr,"cat test.c");

       printf("\rtry %d",i);
       piped_file = popen(pipestr,"r");

       if (piped_file == NULL)
       {   perror("Pipe open");
           printf("Error after testopen nr %d.\n",i);
           return errno;


       while (!feof(piped_file))

    return 0;



For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

More information about the Cygwin mailing list