LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-02-2004, 04:56 AM   #1
chiahsin
LQ Newbie
 
Registered: Dec 2004
Posts: 6

Rep: Reputation: 0
msgrcv problem


hello:

I write a program to receive queue,but get some error

#include <stdio.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <errno.h>
extern int errno;
int main()
{
struct msgbuf1{
long mtype;
char mtext[100];
} rcvbuf , *msgp;
int rtrn, msgqid ;
while(1)
{
msgp=&rcvbuf;
printf("等待queue的資料\n");
rtrn=msgrcv(0x888,msgp,100,001,0);
if (rtrn == -1)
{perror("msgrcv");exit(1);}
}
printf("資料: %s\n",msgp->mtext);
}

here is the error from execution , but not compiling
等待queue的資料
msgrcv: Invalid argument
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPC msgrcv - writing overflows memory extra 4 bytes tara Programming 1 11-09-2005 12:40 AM
message queues: msgrcv uses round-robin? Galmok Programming 0 09-22-2004 04:58 AM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration