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
2
votes
1 answer

ansible - named pipe (mkfifo) - best practice?

I want to create a named pipe with ansible on Linux/Debian. In a shell script I would use the command mkfifo for creating a pipe. Now I'm wondering if there's an builtin module approach but I can't find anything in the builtin modules of…
2
votes
1 answer

Adding timestamps via named pipes or rsyslog to the log output of a systemd-managed service

I'm having to deal with a proprietary legacy service (running on Debian 10) that logs various (roughly) INFO and NOTICE level things things into stdout, and (roughly) WARNING and ERROR level things into stderr. Both can be written to files using the…
JK Laiho
  • 3,538
  • 6
  • 35
  • 42
2
votes
2 answers

Bash howto write/read to/from a named pipe without aborting after first sending

GIVEN: Bash command line (Terminal 1): > mkfifo pipo > cat pipo Bash command line (Terminal 2): > echo -e "Hello World\nHi" > pipo RESULT: The bash in (Terminal 1) prints: Hello World Hi and aborts. QUESTION: How can I achieve that it does…
Frank-Rene Schäfer
  • 3,182
  • 27
  • 51
2
votes
3 answers

inter-process communication between linux and dotnet using mkfifo

We have an application written in c that sends events/notifications to an application written in c#. Both applications run on the same linux computer. The C application: The C application is Asterisk and we modified the source code (it is open…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
2
votes
1 answer

Pipeline Gstreamer RTSP file sinking with big delay

I prepared a IP camera with Gstremer on RTSP and it seems to online and real time, with command: gst-launch-1.0 rtspsrc location=rtsp://192.168.1.138:554/axis-media/media.amp ! rtph264depay ! decodebin ! videoconvert ! autovideosink sync=false it…
Amir Farahani
  • 31
  • 1
  • 5
2
votes
1 answer

poll on FIFO returns immediately in HP-UX

I'm trying to use poll(2) on FIFO on various platforms, but (compared to Linux, Solaris, AIX), HP-UX's behavior is somewhat different to other platforms. Below code creates a FIFO(named pipe) and poll it with 3s timeout. Since this code doesn't…
Byoungchan Lee
  • 1,372
  • 13
  • 28
2
votes
1 answer

node fs.writeFileSync() never returns

I'm creating a pipe and trying to write to it. But the writing never works. import * as fs from 'fs'; import * as mkfifo from 'mkfifo'; mkfifo.mkfifoSync('/tmp/my_fifo', 0o600); fs.writeFileSync('/tmp/my_fifo', 'Hey…
lostdorje
  • 6,150
  • 9
  • 44
  • 86
2
votes
1 answer

Segmentation Fault with mkfifo

I've got a problem with the following code: #include #include #include #include #include int main(int argc, char*argv[]){ FILE * tube; char chaine[10]; mkfifo("glue", 0666); …
Abdelghani Bekka
  • 576
  • 9
  • 18
2
votes
0 answers

Linux C process communication

I got school project in which I need to write a program that forks to 3 child process and they need to communicate: stdin --> PID1 ---fifo---> PID2 ---file---> PID3 ---> stdout CH2 translates that data to hex string. I also need to implement pause…
voidmat
  • 113
  • 3
  • 12
2
votes
2 answers

Pipe access privileges for setuid program

I am extending some software (of which I am not the author) that runs under GNU / Linux (Ubuntu 14.04) and consists of a manager process and several worker processes. The manager can start a worker by means of a command line that I can specify in a…
Giorgio
  • 5,023
  • 6
  • 41
  • 71
2
votes
3 answers

Why is stat() returning EFAULT?

I'm writing a program that when run from two separate bash sessions as two separate processes, opens a named pipe between the two to allow strings to be sent from one to the other. When the process is first executed from one terminal, it checks…
imperfectgrist
  • 621
  • 4
  • 20
2
votes
1 answer

How to use a FIFO in a Linux char device driver so that two process that uses the driver can communicate

I have a char device driver that for a virtual device. I want a FIFO in the device driver so that 2 process using the device driver can transfer characters between them. I tried kfifo but I am new to this and find it difficult to use. Can any body…
goldenptr
  • 321
  • 1
  • 4
  • 14
2
votes
1 answer

Unable to open FIFO for writing

'Server' program side: #define RESP_FIFO_NAME "response" /* Global Variables */ char *cmdfifo = CMD_FIFO_NAME; /* Name of command FIFO. */ char *respfifo = RESP_FIFO_NAME; /* Name of response FIFO. */ int main(int argc, char* argv[]) { int infd,…
ICantNameMe
  • 93
  • 1
  • 1
  • 7
2
votes
2 answers

How to send a file through a named pipe in C?

I have two programs, server and client. Server should read a file and then send its content through a named pipe to client. But my server reads only two chars from file, and then exits. What is wrong with this code? server.c: #include…
yak
  • 3,770
  • 19
  • 60
  • 111
2
votes
1 answer

Ocaml: FIFO's reads incorrectly

Ok, so I am working with FIFO's and I was trying to build a small library to use in future programs. It should be able to create a named pipe, read it and write in it. I was able to do all these functions, but it isn't reading correctly. The problem…
João Bastos
  • 193
  • 1
  • 10