views:

157

answers:

1

I receive msgsnd: Invalid argument error while using my program. Another thing i noted is that error do not occur if the file size is medium while it occurs when file size is slightly more. Is is due to memory overflow? If yes then what is the solution. Regards, Bhavin.

A: 

msgsnd() returns EINVAL if the msgsz parameter is greater than MSGMAX (which is usually quite a small value, like 8192).

What msgsz are you using?

caf
Thanks caf. I found that size of the pkt which i am using is almost 12000. It is the size of pkt which is causing me prblm. Can we change the value of MSGMAX?Regards,Bhavin.
bhavin
That depends on the operating system. On Linux, it can be changed system-wide with the `kernel.msgmax` sysctl (accessible at `/proc/sys/kernel/msgmax`).
caf
Thanks caf i changed it by explicitly using that parameter in /etc/sysctl.conf file and using sysctl -p.Thanks again caf for your reply.Regards,Bhavin
bhavin