On Thursday 26 January 2012 07:44:31 Boyd Lynn Gerber wrote:
On Wed, 25 Jan 2012, Anders Johansson wrote:
On Wednesday 25 January 2012 15:33:00 Boyd Lynn Gerber wrote:
Hi attached are two files that I am using to get one channel open. Now I
need a second. I hate that I can not seem to remember enough C to do it.
Any assistence would be greatly appreciated.
I'm not sure I understand the question. You are opening a message queue as
an IPC channel. What is stopping you from opening a second channel in the
same way?
The second one always returns a negative number.
#include
#include
#include
#include
#include
#include
#include
int ret;
int main(void){
ret = msgget(....);
if (ret < 0){
fprintf(stderr, "msgget failed: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
ret = msgget(.....);
if (ret < 0){
fprintf(stderr, "msgget failed: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
return 0;
}
That is how you get a program to tell you what's wrong. With an error message
from msgget, you should be able to figure out what is going wrong.
Anders
--
To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-programming+owner@opensuse.org