Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~606 People Reached
Favorite Forums
Favorite Tags
c x 2
c++ x 1
Member Avatar for kubatur0

Hi there... I have the msgsnd code: [CODE](...) char *c1="./df"; if(!(df=(FILE*)popen(c1,"r"))){fprintf(stderr,"pipe1 problem");} s1.mtype=1; while(true){ time3=time(NULL); if((time3-time4)>3){ fgets(s1.mtext,1000,df); time4=time3; if(msgsnd(msqid,&s1,1000,msgflg)<0){fprintf(stderr,"sending1 problem\n"); perror("g");};} } } else if(pID1<0){ printf("failed to fork1\n");} else{ prid2 = nproc2();} return pID1; }[/CODE] and the msgrcv code [CODE]msgbuf rcv; while(true){ time1=time(NULL); if((time1-time2)>1){time2=time1; if(msgrcv(msqid,&rcv,1000,1,msgflg)<0){fprintf(stderr,"rcv problem");};printf("%d : %s\n",time1,rcv.mtext);}}} return pID3; …

Member Avatar for wisaacs
0
509
Member Avatar for kubatur0

[code]#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> #include <string.h> typedef struct msgbuf { long mtype; FILE *mtext; } message_buf; main(){ int msqid; int msgflg = IPC_CREAT | 0666; key_t key; message_buf sbuf; size_t buf_length; key = 1234; if ((msqid = msgget(key, msgflg )) < 0){ perror("msgget"); exit(1); …

Member Avatar for oieronle
0
97