Write to a dead end
I have a problem in my program that is using pipes.
What I am doing is using pipes along with fork / exec to send data to another process.
I have something like this:
// pipes are created up here
if (fork () == 0) // child process
{
...
execlp (...);
}
else
{
...
fprintf (stderr, "Writing to pipe now \ n");
write (pipe, buffer, BUFFER_SIZE);
fprintf (stderr, "Wrote to pipe!");
...
}
This is fine for most messages, but when the message is very large, write to dead-end pipes.
I think the pipe might be full, but I don't know how to clean it. I tried using fsync but it didn't work.
Can anyone help me?
+2
a source to share