mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <gskiran@bgl.vsnl.net.in>
To: linux-kernel@vger.kernel.org
Subject: Linux Kernel Message Queue Implementation
Date: Tue, Feb 18, 2003 at 19:47:52 IST (GMT+0530)	[thread overview]
Message-ID: <20030218141257.1475574B6@blr.vsnl.net.in> (raw)

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

[1] msgsnd (int, struct msgbuf *, int, int) INTERFACE ERROR !!

[2] msgsnd() has "struct msgbuf*" as its 2nd parameter. When I tried to write an application which uses message queues for IPC i declared my message queue buffer as -

struct my_msgq_buf
{
    long mtype;
    char *name;
    double amount;
};

I allocated the memory of name dynamically using "malloc" and wrote into the message Queue using msgsnd. And the msgsnd returns successfully. When I do an msgrcv with the above structure type, I always recieve NULL values in my structure buffer !! 

But, When I use the structure as declared below -

struct my_msgq_buf
{
    long mtype;
    char name[30];
    double amount;
};

Every thing interstingly seems to be working fine.! The interface for msgsnd and msgrcv should have "void *" pointers rather than having a "struct msgbuf *" as parameters.

[3] Kernel
[4] 2.4.7-10 
[5] 
[6]
[7] i586. Intel Pentium 166 MHz MMX.
[8]


             reply	other threads:[~2003-02-18 14:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-18 14:08 gskiran [this message]
2003-02-18 15:25 ` Erik Mouw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030218141257.1475574B6@blr.vsnl.net.in \
    --to=gskiran@bgl.vsnl.net.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®