msgrcv返回7是怎么回事?

aozhi 2010-03-18 06:42:26
调用
msgrcv(id,&buf,sizeof(buf的类型)-sizeof(int),0,0);
返回了-1

errno=7
argument list too long.

会是什么原因呢?
谢谢
...全文
511 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aozhi 2010-03-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 mymtom 的回复:]
int
msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);

消息字节数超过了第三个参数(msgsz),而且没有设置MSG_NOERROR标志

[E2BIG] A matching message was received, but its size was
greater than msgsz ……
[/Quote]

在以前的solaris上好像不出错,到Linux上就出错了,奇怪。
cy330206 2010-03-18
  • 打赏
  • 举报
回复
http://blog.sina.com.cn/s/blog_510f720a01008tzs.html
楼主看看这个链接,
mymtom 2010-03-18
  • 打赏
  • 举报
回复
int
msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);

消息字节数超过了第三个参数(msgsz),而且没有设置MSG_NOERROR标志

[E2BIG] A matching message was received, but its size was
greater than msgsz and the MSG_NOERROR flag was not
set in msgflg.

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧