0% found this document useful (0 votes)
28 views11 pages

IPC and Related System Calls

This document discusses various methods of inter-process communication (IPC) including message passing using pipes, queues, and semaphores as well as memory-based techniques like shared memory and memory mapped files. It also outlines the related Linux system calls used for first-in-first-out pipes, message queues, signals, shared memory, and socket programming.

Uploaded by

Shreeji Sheth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views11 pages

IPC and Related System Calls

This document discusses various methods of inter-process communication (IPC) including message passing using pipes, queues, and semaphores as well as memory-based techniques like shared memory and memory mapped files. It also outlines the related Linux system calls used for first-in-first-out pipes, message queues, signals, shared memory, and socket programming.

Uploaded by

Shreeji Sheth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Inter Process Communication and

related system calls

Prepared by:
Shreeji Sheth
Technical Associate (Embedded)| eiTRA

Methods for IPC


l
l

Message Passing base


Memory based

Message Passing based


l

l
l

l
l

Pipe-works for parent and child or child of


common parent process
Queue
FIFO-named pipes-supports more then one
readers and writers
Semaphores
Signaling

Memory Based
l
l

Shared memory
Memory mapped files

System Calls
l
l
l
l
l
l
l

FIFO
int mkfifo(const char *pathname, mode_t mode);
Mknod
Open(),close(),unlink()
Read(), write()-4k max
Write operation is atomic
Opening FIFO for read or write blocks until other
process opens it for write or read

System Calls...
l
l
l

Pipe
Pipe()
Read(),write(),close()

System Calls...
l
l

Queue
Msgget(), msgctl(), msgsnd(), msgrcv(),

System Calls...
l
l
l

Signals
Signal.h
int kill(int pid, int signal); //where signal value
can be SIGHUP 1 /* hangup */ ;SIGINT 2 /*
interrupt */; SIGQUIT 3 /* quit */; SIGILL 4 /*
illegal instruction */; SIGABRT 6 /* used by
abort */; SIGKILL 9 /* hard kill */; SIGALRM
14 /* alarm clock */; SIGCONT 19 /* continue a
stopped process */; SIGCHLD 20 /* to parent
on child stop or exit */

System Calls...
Signals
int raise(int sig) equivalent to kill(getpid(), sig);
int sighold(int sig) -- adds sig to the calling
process's signal mask
int sigrelse(int sig) -- removes sig from the calling
process's signal mask
int sigignore(int sig) -- sets the disposition of sig to
SIG_IGN
int sigpause(int sig) -- removes sig from the
calling process's signal mask and suspends the
calling process until a signal is received

System calls...
l
l
l
l
l

Shared Memory
Shmget()
Ftok()
Shmat(),shmdt(),shmctl()
Shmat() returns pointer to the shared memory
segment

System Calls
l
l

Socket programming
Socket(),
bind(),connect(),listen(),accept(),recvfrom(),sen
dto()-for connection less,recv(),send()-for
connection oriented, close(),

You might also like