Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice!sun-spots-request From: stelmack@screamer.csee.usf.edu (Gregory M. Stelmack) Newsgroups: comp.sys.sun Subject: IPC under SunOS 4.0.3 Keywords: SunOS Message-ID: <281@brchh104.bnr.ca> Date: 16 Nov 90 12:05:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 41 Approved: Sun-Spots@rice.edu X-Original-Date: 29 Oct 90 20:46:11 GMT X-Sun-Spots-Digest: Volume 9, Issue 367, message 1 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu I am trying to use the message passing facility of IPC on a Sun running 4.0.3. Unfortunately, I can't even get the msgget() call to work right. I have checked the man pages to no avail, and no one around here has done anything with this part of the OS (at least, not that I've found -- someone from our Tech Support is still looking for me). Does anyone out there have this working, and if so would they mind sending me a small chunk of code showing how they did it and what must be done to compile it? My code currently looks something like this: #include #include #include ... key_t GS_msgkey = 75; int GS_msgid; ... GS_msgid = msgget(GS_msgkey,0777|IPC_CREAT); /* Have tried: 0777&IPC_CREAT and just IPC_CREAT, still same error */ perror("server1"); if (GS_msgid==-1) { printf("server: could not get message queue\n"); exit(0); } perror prints: server1:Invalid Argument then I get the "could not get message queue" message. I have tried lots of combinations of ways of defining GS_msgkey (int, #define, hardcode) and lots of values, plus the various ways of setting the flags mentioned above. What stupid, stupid thing am I doing wrong???????? Thanks in advance, -- Gregory M. Stelmack -- stelmack@sol.csee.usf.edu