Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!torsqnt!lethe!geac!maccs!antel!geoff From: geoff@antel.uucp (Geoff Vona) Newsgroups: comp.unix.i386 Subject: Message queues. Possibly dumb mistake. Message-ID: <1989Dec7.150205.12104@antel.uucp> Date: 7 Dec 89 15:02:05 GMT Organization: Antel Optronics Inc. Lines: 42 Hope someone can help me with this. Its gotta be something stupid that I'm doing, but... I'm trying to use messages and queues under 386/ix 2.0.2 and I'm having problems. In msgsnd and msgrcv, messages are passed using a structure called msgbuf that looks like this: struct msgbuf { long mtype; char mtext[1]; }; (from /usr/include/sys/msg.h) However, my documentation (?) sez it should be struct msgbuf { long mtype; char mtext[]; }; What I want to do is pretty simple: Assign a string of text (something profound like "This is a test") to this buffer and send it to another process that I start up. In other words; strcpy(gumby.mtext,"This is a test"); gumby.mtype = 2; result = msgsnd(qid,&gumby,strlen(gumby.mtext),flag); Unfortunately, I can't create any space for the buffer because its only a char[1]. Maybe I'm using the wrong mechanism? (Maybe I should be sent to remedial C school!) Please respond by e-mail if the solution is simple and would simply clutter up the net. -- Geoff Vona | "One likes to believe Antel Optronics Inc. | In the freedom of music 3325B Mainway Burlington, | But glittering prizes Ontario, Canada L7M 1A6 | And endless compromises