[opensuse-programming] New C only example files that open on channel for reading and writing. Now I want to get two open. This is for openSUSE 11.4, 12.1 and SLES.

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. Thanks in advance. -- Boyd Gerber <gerberb@zenez.com> 801 849-0213 ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

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? Anders -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-programming+owner@opensuse.org

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. Same as with my combined C and fortran. I was hoping someone could show me the proper way. So I posted what works for a single channel, but fails on the second. -- Boyd Gerber <gerberb@zenez.com> 801 849-0213 ZENEZ 1042 East Fort Union #135, Midvale Utah 84047 -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-programming+owner@opensuse.org

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 <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> #include <errno.h> 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
participants (3)
-
Anders Johansson
-
Anders Johansson
-
Boyd Lynn Gerber