Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A capability supported by some operating systems that
allows one process to communicate with
another process.
Introduction
Pipes
popen and pclose functions
1
Introduction
Forms of IPC
•Pipes(half duplex)
•FIFO(named pipes)
•Stream pipes(full duplex)
•Named stream pipes B/W process on
•Message queues the same host
•Semaphores
•Shared memory
•Sockets processes on diff.
2
•Streams hosts
Pipes
#include<unistd.h>
int pipe(int filedes[2]);
return 0 if ok -1 on error
333
Limitations of pipes
4
Parent child
fork
fd[0] fd[1]
fd[0] fd[1]
pipe
kernel
6
popen and pclose functions
#include<stdio.h>
FILE *popen(const char *cmdstring,const char *type);
type r(read) or w(write)
Returns: fp if ok,null on error