07 June

How to get OS version in C?

In this post we are going to solve a common question that dazzles most programmers – How to get OS version in C? When building an application sometimes a requirement is to check the operating system version. Programmers find it difficult to achieve this in C language. The solution to the above question is using […]

10 May

Program for wait() system call

When a process creates a child process, sometimes it becomes necessary that the parent process should execute only after the child has finished. wait() system call does exactly this. It makes the parent process wait for child process to finish and then the parent continues its working from the statement after the wait().To be exact […]

13 April

Program for IPC using named pipes (mkfifo())

Program for IPC using named pipes (mkfifo()) The third method for IPC is using mkfifo() function. mkfifo() creates a named pipe which can be used exactly like a file. So, if you know how to read/write in a file this is a convenient method for IPC Syntax: #include<sys/types.h>#include<sys/stat.h>int mkfifo(const char *pathname, mode_t mode); mkfifo() makes […]

09 April

Program for IPC using pipe() function

The second method for IPC is using the pipe() function. Before writing a program for IPC using pipe() function let us first understand its working. Syntax: #include<unistd.h>int pipe(int pipefd[2]); pipe() function creates a unidirectional pipe for IPC. On success it return two file descriptors pipefd[0] and pipefd[1]. pipefd[0] is the reading end of the pipe. […]