LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problems using named pipes (https://www.linuxquestions.org/questions/linux-software-2/problems-using-named-pipes-747017/)

shayke23 08-12-2009 10:34 AM

problems using named pipes
 
hi all,

i've written a client app, interacting with a proxy thru named pipes.
say, in.pipe is the named pipe the proxy reads from (the client writes to)
and the same deal with out.pipe.

the problem is, that under linux 9.04 it works perfect.
under redhat, the app get stuck.

in my code i open the named pipes with:
Code:

        int write_pipe  = open(in.pipe,O_WRONLY);
          int read_pipe  = open(write.pipe,O_RDONLY);

my question is:
maybe under redhat i suppose to open the pipes in a different way?

thx!

btw, i create the named pipes with the shell command:
Code:

mkfifo --mode=0666 in.pipe out.pipe

business_kid 08-12-2009 12:52 PM

No coding expert, but mode=0666 makes them read/write to the world. The in pipe should surely be 0444

That aside, what uid/gid are you running as? Has that user read/write perms wherever you are putting the pipe?

shayke23 08-13-2009 12:18 AM

Quote:

Originally Posted by business_kid (Post 3640795)
No coding expert, but mode=0666 makes them read/write to the world. The in pipe should surely be 0444

That aside, what uid/gid are you running as? Has that user read/write perms wherever you are putting the pipe?

the in pipe cant be 0444 because than u can just read from it. nobody has permission to write to it so u must have at least 1 write bit lit.

the problem solved anyway. it was a problem concerning the permissions rather than pipes problem.

thx alot!


All times are GMT -5. The time now is 03:18 AM.