Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!styx!ptsfa!hoptoad!academ!uhnix1!coscilr From: coscilr@uhnix1.UUCP (09097) Newsgroups: comp.unix.questions Subject: Re: System V.2 IPC (msgop - message passing) ? Message-ID: <560@uhnix1.UUCP> Date: Tue, 28-Apr-87 16:53:30 EDT Article-I.D.: uhnix1.560 Posted: Tue Apr 28 16:53:30 1987 Date-Received: Thu, 7-May-87 07:23:28 EDT References: <419@artecon.artecon.UUCP> Reply-To: coscilr@uhnix1.UUCP Francis Distribution: comp.unix.questions Organization: University of Houston Lines: 25 Keywords: Include file definitions In article <419@artecon.artecon.UUCP> tony@artecon.artecon.UUCP (Anthony D. Parkhurst) writes: > >Question about System V message passing (IPC): > >In the man pages for msgop(2), it shows the message to be passed >as type *msgbuf. The man pages say the struct is: > >struct msgbuf{ > int mtype; /* type of message (arbitrary) */ > char mtext[]; /* body of message */ > } > >Now this implies that the pointer mtext can be assigned to an >array or can be malloc'd to. (which makes sense) Redefine msgbuf in your program instead of in the header file itself. Use struct msgbuf1{ int mtype; char mtext[100]; } for example. The definition in the header file serves only as a template which cannot be used directly. Francis (CSNET: mkkam@houston.edu)