EmbLogic's Blog

Author Archives: Ankur Garg

Basic linklist operations

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

Posted in Data Structures with C | Tagged , , , , , , , , | Leave a comment

How to Send a signal -Using Kill command

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , , , | Leave a comment

How to register a signal

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , , | Leave a comment

About Signals

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , | Leave a comment

Replacing a Process Image

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , , | Leave a comment

Orphan Process

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , | Leave a comment

Zombie or Defunct Process

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , | Leave a comment

waiting for a process

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , | Leave a comment

Process Duplication using fork

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

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , | Leave a comment

Multiple Data Compressions And Encription Using Iterative Technique

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

Posted in Data Structures with C, Project 2: Multiple Data Compression and Encryption | Tagged , , , , , , , , , , | Leave a comment

Types of Interprocess Communications in Linux

Types of Inter-process Communications (IPCs) in Linux : 1. Pipes 2. Named Pipes/FIFO 3. Signals 4. Semaphores 5. Message Queue 6. Shared Memory  

Posted in Project 03: Client Server Communication using Linux and IPC | Tagged , , | Leave a comment

Selection Sorting in C

#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

Posted in Data Structures with C | Tagged , , , , , | Leave a comment

Bubble Sorting in C

#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

Posted in Data Structures with C | Tagged , , , , | Leave a comment

Insertion Sorting

#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

Posted in Data Structures with C | Tagged , , , | Leave a comment

Client Server Using IPC by using message queues and pipes for single user

logfile of project ============= ============= RCS file: header.h,v Working file: header.h head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: It includes basic headers for implementation It includes … Continue reading

Posted in Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , | Leave a comment