This program shows how to create process and display Process ID (pid) of Both Parent and Child processes. The process is created using the fork system call in UNIX (Linux) operating systems.
#include<stdio.h>
#include<dirent.h>
main(int argc,char **argv)
{
Information about resetting and configuring Mobile phones (Java, Android, Symbian etc), educational articles especially for programming in C, C++ and Java and more about Computers and operating systems
Showing posts with label create. Show all posts
Showing posts with label create. Show all posts
How to Create process and display Process ID (pid) of Both Parent and Child
Labels:
$ccpp
,
c program
,
code
,
compiled
,
create
,
display
,
fork
,
getpid
,
lab
,
Linux
,
operating Systems
,
OS
,
Oslab
,
process
,
process id
,
programming
,
source code
,
system call
,
UNIX
Creating A Process in Linux (UNIX) - fork() Example Program
The system call fork() is used to create a new process in UNIX based operating systems and Linux systems. The fork() system call creates a child process when called from a parent process. Unix will make an exact copy of the parent's address space and give it
to the child. Therefore, the parent and child processes have separate
address spaces. Here is a C program which uses the fork() system call to create a process during execution. The program is commented well for better understanding.
Program
/*The program (parent process) reads an array from the user.
It sorts it in descending order.
Program
/*The program (parent process) reads an array from the user.
It sorts it in descending order.
How to Make a AutoRun CD or DVD Using Autorun.inf
In this post we will see how to setup autorun on a CD or Pen drive using Autorun.inf file. If you are planning to create a CD with autorun (launch a file automatically on insertion of disc), this post will be helpful for you. If you are not much familiar with AutoRun, read the following post, to get an idea about autorun feature: What is AutoRun or AutoPlay and How to Set it?
Now, we see how to make an autorun CD.
How to make tables using HTML code
In HTML (Hyper Text markup Language), <table> tag is used to create tables. Table is basically meant to represent data in tabular form. But people also use tables to design webpages, especially when they want to divide the web pages into some equal blocks. Now we will start with the basics of table tag. The table starts with a <table> tag and ends with the HTML tag </table>. Whatever comes in between <table> and </table> is either the data in the table or further HTML codes to design the table. These two tags help only to inform the starting and ending of the table.
C Program To Represent Directed or Undirected Graph Using Adjacency Matrix
C program to represent directed or undirected graph using Adjacency matrix.
#include<stdio.h> #include<conio.h> #define max 20 int adj[max][max]; //Adjacency matrix int n; //Denotes number of nodes in the graph void main() {
Labels:
$ccpp
,
adjacency
,
c program
,
code
,
create
,
data structure
,
directed
,
graph
,
graphs
,
How to
,
matrices
,
matrix
,
programming
,
represent
,
representation
,
undirected
,
using
Subscribe to:
Posts
(
Atom
)