EmbLogic's Blog

Category Archives: Uncategorized

A chat client ( to chat between two terminals) : Source code snippet

ret_msnd = msgsnd(ret_mget, &m_p, sizeof(struct content), 0); 89 if(strcmp(m_p.con.msg, “exit”) == 10) 90 { 91 printf(“Client 1 says bye\n”); 92 kill(pid, SIGINT); /* kill the child generated for reading the inbox, before parent goe s off */ 93 exit(EXIT_SUCCESS); 94 … Continue reading

Posted in Uncategorized | Leave a comment

difference b/w printf ,fprintf,snprintf and sprintf

printf, fprintf, sprintf, snprintf C File input/output Defined in header <stdio.h> (1) ?int printf( const char          *format, … );?   ?int printf( const char *restrict format, … );?   (2) int fprintf( FILE       … Continue reading

Posted in Uncategorized | Leave a comment

IPC USING FIFOS AND SEMAPHORES

****************************************************************************************** RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: Made a server file which takes request from client and forwards it to processing client Then it takes … Continue reading

Posted in Uncategorized | Leave a comment

IPC USING FIFOS AND SEMAPHORES.

HEADER FILE *************************************************************** RCS file: ./header.h,v Working file: ./header.h head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1;    selected revisions: 1 description: Included “stdio.h” , “stdlib.h”, “unistd.h”, “linux/sem.h”, “fcntl.h”, and “signal.h”. Declaration of the … Continue reading

Posted in Uncategorized | Leave a comment

IPC(Inter Process Communication) using pipes

RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: made the server to perform three operations but can create file descriptors upto 100 ============================================================================= RCS file: add.c,v Working … Continue reading

Posted in Uncategorized | Leave a comment

linklist all done !

RCS file: ./linklist1.c,v Working file: ./linklist1.c head: 1.5 branch: locks: strict root: 1.5 access list: symbolic names: keyword substitution: kv total revisions: 5; selected revisions: 5 description: make a struct for linklist and defined three pointers start,prev,end . data store … Continue reading

Posted in Uncategorized | Leave a comment

rlog /client ,server model using ipc/

RCS file: server.c,v Working file: server.c head: 1.17 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 17; selected revisions: 17 description: data form the all the clients have been taken successfully server calls the client by … Continue reading

Posted in Uncategorized | Leave a comment

rlog / link list / complete

RCS file: ll_comp.c,v Working file: ll_comp.c head: 1.25 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 25; selected revisions: 25 description: creatin , insertion at the end is completed —————————- revision 1.25 date: 2014/07/30 14:23:28; author: … Continue reading

Posted in Uncategorized | Leave a comment

INTER PROCESS COMMUNICATION USING PIPES.(client server based)

INTER PROCESS COMMUNICATION USING PIPES. RCS file: header.h,v Working file: header.h head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1;    selected revisions: 1 description: Included stdio.h. and fcntl.h. ,sys/types.h, stdlib.h, unistd.h. —————————- revision 1.1 … Continue reading

Posted in Uncategorized | Leave a comment

about proc, proc_create,proc_entry

The proc file system is an interface between the kernel and the userspace. Every entry in the proc file system provides some information from the kernel. For eg: The entry “meminfo” gives the details of the memory being used in … Continue reading

Posted in Uncategorized | Leave a comment

stack implemented successfully.

RCS file: main.c,v Working file: main.c head: 1.7 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 7; selected revisions: 7 description: creat main menu —————————- revision 1.7 date: 2014/07/25 09:18:02; author: root; state: Exp; lines: +1 … Continue reading

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

Implemented Circular Queues with linked lists

#include<stdio.h> #include<stdlib.h> int flag=0; struct node { int val; struct node*next; }*front=NULL,*rear=NULL,*start=NULL; int count=0; int get_choice(int *); int create_node(); int enqueue(); int dequeue(); int display(); int main() { int choice=1; while(choice) { printf(“\n+++++++++MENU+++++++++\n”); printf(“1.CREATE NODE\n”); printf(“2.INSERT\n”); printf(“3.DELETE\n”); printf(“4.DISPLAY\n”); printf(“0.EXIT\n”); printf(“enter … Continue reading

Posted in Uncategorized | Leave a comment

Implemented Queues with linked lists

#include<stdio.h> #include<stdlib.h> struct node { int val; struct node*next; }*front,*rear,*start=NULL; int flag=0; int get_choice(int*); int create_node(); int enqueue(); int dequeue(); int display(); int main() { int choice=1; while (choice) { printf(“+++++++++++++++++++MENU++++++++++++++++++++++\n                “); printf(”                1.CREATE NODE                \n                “); printf(”                2.ENQUEUE                    \n                … Continue reading

Posted in Uncategorized | Leave a comment

what is the error in following code?

Point out the error in the following program. #include #include void varfun(int n, …); int main() { varfun(3, 7, -11.2, 0.66); return 0; } void varfun(int n, …) { float *ptr; int num; va_start(ptr, n); num = va_arg(ptr, int); printf(“%d”, … Continue reading

Posted in Uncategorized | Leave a comment

is there any structure declaration in header file ?

A header file contains macros, structure declaration and function prototypes. A. True B.false

Posted in Uncategorized | Leave a comment