Questions tagged [mkfifo]

Creates a named-pipe (aka FIFO)

A named pipe, also called a FIFO for its behaviour, can be used to connect two unrelated processes and exists independently of the processes; meaning it can exist even if no one is using it. A FIFO is created using the mkfifo() library function.


What is considered related processes?

Probably processes which are related via one or more parent/child relations (e.g. includes siblings). The common ancestor would have created the two ends of the pipe. Unrelated processes lack that common ancestor.

229 questions
0
votes
1 answer

Inter Process Communication FIFO java

Hi I'm trying to Implement a IPC in Java with FIFO I cretaed a FIFO with with mkfifo temp then I tried to open and FileWriter with BufferedWriter writeStream = new BufferedWriter(new FileWriter(writePipePath)); but it blocks at this line. Any idea…
user2071938
  • 2,055
  • 6
  • 28
  • 60
0
votes
1 answer

mkfifo() not creating file in C

I'm trying to create a named pipe in C, but have not had any success. Here is my code: pid_t pid = getpid() ; char * pipeNameo = malloc( sizeof(char) * 100 ) ; len = 0 ; //len += sprintf( pipeNameo + len, "%s", "/Users/Davidb/Desktop/") ; // tried…
David Baez
  • 1,208
  • 1
  • 14
  • 26
0
votes
4 answers

can not open FIFO

I write this program to test the FIFO in Ubuntu。The main program create a child process to write something ,and then the parent read and print it /* communication with named pipe(or FIFO) @author myqiqiang @email …
Wythe
  • 149
  • 3
  • 12
0
votes
0 answers

IPC using FIFO in UNIX environment

I am trying to implement a IPC using FIFO. The code for sender is as follows.. #include #include #include #include #include #include #include #include #define…
user2504710
  • 42
  • 1
  • 8
0
votes
2 answers

using named pipes to implement chat in C

I have created two pipes for client and server using FIFO named pipes. Then I tried to execute the communication between client and server. The communication works when sending messages from client to server but not vice versa. kindly help. here are…
user2899997
  • 3
  • 1
  • 4
0
votes
3 answers

Weird behaviour of FIFO reading/writing in C

I've got a C program that reproduces a server using FIFOs. The program reads two lines from an input FIFO — a number n and a string str— and writes on an output FIFO n lines, each of which is a single occurrence of str. I wrote the following…
Dree
  • 702
  • 9
  • 29
0
votes
0 answers

Using Python to write a request to one FIFO and read a response from another FIFO

I need to communicate with a process (Kamailio SIP server) using named FIFOs in /tmp. The way it works is that I need to set up a response FIFO of my own and then write the request to Kamailio which will write the response back to my FIFO. So, how I…
vaizki
  • 1,678
  • 1
  • 9
  • 12
0
votes
1 answer

Limiting posix_mkfifo

In PHP, there's a call: posix_mkfifo() which basically makes a fifo. Is there a way to set a limit on this file/fifo? Otherwise, if no one is pulling data out, it can grow unbounded. Thanks in advance for any help.
user645402
  • 737
  • 1
  • 16
  • 34
0
votes
1 answer

Wait until 2 pid write to FIFO(named pipe)

Im trying to make a Tic Tac Toe game with server-client using FIFO(named pipe) and shared memory. The first step is to write the pid of the client process to the FIFO. And in the server process i need to wait until 2 pids was passed in the FIFO…
asaf
  • 331
  • 2
  • 6
  • 21
0
votes
0 answers

Reopening existing FIFO gives error "No such file or directory"

I am trying to realize a very simple communication between a PHP website and a C++ program. The solution chosen was to make use of Linux fifo's. This works well for the first command, but when we try to reopen the file, an error is returned. See the…
Schiavini
  • 2,869
  • 2
  • 23
  • 49
0
votes
2 answers

Multiple reader/writer on FIFO (named pipe)

I've created a named pipe using mkfifo and opened a reader and writer on it. I then went on to open a second reader/writer on the same fifo but open returns ENXIO instead. std::string n = "/tmp/test"; int err; err = mkfifo(n.c_str(), 0666); if (err…
Zach Saw
  • 4,308
  • 3
  • 33
  • 49
0
votes
1 answer

Linux pipelines using C programming. Redirecting inputs/outputs through pipelines

I'm very beginner with linux however I've managed to do my own shell. It's time to add pipelines in there. (That's what, the homework says). Could anyone explain me a little bit more how to do that? I know that in theory, it should work like…
Patryk
  • 3,042
  • 11
  • 41
  • 83
0
votes
2 answers

Opening pipe in append mode

I'm trying to open a fifo pipe, into which one thread writes, the synchronization is all good. However, for understandable reasons I need it to be opened in append mode. When I open it as follow: ret_val = mkfifo(lpipename.c_str(), 0666); …
Alon_T
  • 1,430
  • 4
  • 26
  • 47
-1
votes
1 answer

Cannot Write in Named Pipe

In this code my program crashes in when I am opening the pipe for writing. char pipe[30]; int fd, tmp = 2; sprintf(pipe, "root_%d", getpid()); ret_val = mkfifo(pipe, 0666); fd = open(pipe, O_WRONLY); //HERE IS CRASHING - SUDDENLY FREEZES write(fd,…
Nick Stavr
  • 13
  • 4
-1
votes
2 answers

Named pipe block child process that uses pipe in C

The child_filter has to read values from pipefd and write these in a named pipe. The problem is that if i try to un-comment the comment[3] (the open of the named-pipe) the function won't print values, it seem to be stuck on read() call. Instead, if…
1 2 3
15
16