Relative Content

Tag Archive for cpipe

Any suggestions on how to avoid getting the bad file descriptor error on write()?

I’ve been at this for a while and I’m not sure why I keep getting the bad file descriptor error, I imagine it’s maybe related to the clone() function, and how I’m trying to pass the pipe as an argument, but I’m not sure, I’ve tried looking it up online, but still haven’t found an answer for this yet. I did try using signals still wasn’t able to make it work.

Any suggestion on how to avoid getting the bad file descriptor error on write()?

I’ve been at this for a while and I’m not sure why I keep getting the bad file descriptor error, I imagine it’s maybe related to the clone() function, and how I’m trying to pass the pipe as an argument, but I’m not sure, I’ve tried looking it up online, but still haven’t found an answer for this yet. I did try using signals still wasn’t able to make it work.

The non blocking read pipe end still show pipe is full even when i send a message

What i want to do with the program is to create 3 child processes from one parent . Each child will have 2 pipes connecting to the parent so it can write to the parent and read from it. With this i want the children to communicate with each other trough the parent for example child 1 decides to send a message to child 3 it will first send to the parent then the parent will send it to child 3. To do that i need to make the read pipe ends non blocking. When no massage has been send it works fine but when i try to send something it still writes that pipe is full. My questions is what i am doing wrong?

I have some problems with non blocking pipes in my c program

I an trying to create a program in c that has one parent process and three child ones. The aim is that the parent will be connected with each child with two pipes so when the children choose to send a message to one of their siblings they will send it first to the parent and then it will send it to the appropriate child. The read ends of the parent have to be non-blocking .