Program crashes on calling __libc_msgrcv()

Hi,

I am a newbie to linux programming. I have implemented msgqueue in C.
msgrcv() call at the client end is as below:
msgrcv( msgqid, msgptr, msgsize, msgtype, 0 );

My program works fine when msgrcv () from /lib/libc.so.6 is called.
However it crashes when __libc_msgrcv() is called.

I would like to know the difference between msgrcv() and __libc_msgrcv() calls and would like to know under what conditions __libc_msgrcv() would be invoked so that I can recreate the issue.

Thanks in advance for your inputs!!!

Could you please elaborate more, showing the relevant part of your code? __libc_msgrcv and msgrcv are different names for the same function, that in turn is a wrapper to the real system call, named ipc(2) in Linux. (Glibc does this using a GCC extension attribute named "alias"). Normally you should use the standard (system V) name for the function, msgrcv.

Quite often function names that begin with an _ are reserved by the compiler and those that begin with __ by the assembler...so use them carefully as they can cause confusion.

We'll need to see your code to tell you why it's crashing.