RCS file: header.h,v Working file: header.h head: 1.1 branch: locks: strict a: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: stdio.h and stdlib.h are added. —————————- revision 1.1 locked by: a; date: 2015/07/02 … Continue reading
Send a signal by Kill command ======================= – To send a signal to a process other than current task. – It has prototype :- int kill(pid_t pid, int signo); – It is included using header :- #include<signal.h> – The system … Continue reading
Register a signal ================== – Program can handle a signal using signal library function signal(). – signal() is used to register the signal handler function with kernel on behalf of current process. – It is included in header :- #include<header.h> … Continue reading
Signals ======== – A signal is an event generated by UNIX/LINUX system in response to some condition. – On receipt of a signal, process may in turn take some action. – Signals are generated by some error conditions such as:- … Continue reading
Replacing a Process Image ========================= – The exec function replaces current process with a new process. – The path of new process is specified as argument to exec. – It is defined in header : #include<unistd.h> – Last argument of … Continue reading
Orphan Process =============== If in a process, the parent process is terminated before the child process, the child process become orphan – It takes the lowest possible process as its parent – And its PPID is changed to the PID … Continue reading
Zombie or Defunct Process ========================== If a child proces tries to teminate,its association with parent remains until the parent terminates normally or calls wait. – The child process entry in process table is therfore not freed up immediately. – Althougth … Continue reading
Waiting For a Process ===================== – Sometime we would like to find out when a child process has finished. – It is needed for parent process to wait until the child finishes before continuing by calling wait. – It has … Continue reading
Process Duplication using system call fork ============================== – A new process is created using fork(). – fork() is a system call. – fork duplicates the current process. – It creates a new entry in the process table with many of … Continue reading
Logfile of compleated Project ————————————————— ————————————————— RCS file: header.h,v Working file: header.h head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: It includes basic headers which are used … Continue reading
Types of Inter-process Communications (IPCs) in Linux : 1. Pipes 2. Named Pipes/FIFO 3. Signals 4. Semaphores 5. Message Queue 6. Shared Memory
#include<stdio.h> //Program for Selection Sorting int main() { int i,j,a[100],N,temp; printf(“Enter no.of elements you want to sort:\t”); scanf(“%d”,&N);//max no. of elements printf(“Enter %d elements you want to sort:\n”,N); for(i=0;i<N;i++) scanf(“%d”,(a+i)); printf(“\nBefore sorting:\t”); for(i=0;i<N;i++) printf(“%d\t”,*(a+i)); //Sorting Starts for(i=0;i<N-1;i++) for(j=i+1;j<N;j++) if(a[i]>a[j]) { … Continue reading
#include<stdio.h> //Program for Bubble Sorting int main() { int i,j,a[100],N,temp; printf(“Enter no.of elements you want to sort:\t”); scanf(“%d”,&N);//Max. no. of elements printf(“Enter %d elements you want to sort:\n”,N); for(i=0;i<N;i++) scanf(“%d”,(a+i)); printf(“\nBefore sorting:\t”); for(i=0;i<N;i++) printf(“%d\t”,*(a+i)); //Sorting Starts for(i=0;i<N-1;i++) for(j=0;j<N-i-1;j++) if(a[j]>a[j+1]) { … Continue reading
#include<stdio.h> //Program for Insertion Sorting int main() { int i,j,k,N,a[100],temp; printf(“Enter no. of elements you want to sort :\t”); scanf(“%d”,&N);//Max. no. of elements printf(“Enter %d elements you want to sort :\t”,N); for(i=0;i<N;i++) scanf(“%d”,(a+i)); printf(“\nBefore Sorting:\t”); for(i=0;i<N;i++) printf(“%d\t”,*(a+i)); //Sorting Process Start … Continue reading