- 论坛徽章:
- 0
|
本帖最后由 vupiggy 于 2011-06-14 15:16 编辑
哇咔咔,咋这多不看手册的嗫,RTFM!
22 是 EINVAL,man semget
- ...
- EINVAL nsems is less than 0 or greater than the limit on the number of semaphores per semaphore set (SEMMSL),
- or a semaphore set corresponding to key already exists, and nsems is larger than the number of sema‐
- phores in that set.
- ...
复制代码 返回 EINVAL 只有 3 种可能。
检查你调用 semget 的场景,你的 nsems 是 10,大于0,没问题,SEMMSL 打出来看一下,是250,10 < 250 也没问题,剩下唯一的可能就是,以 123 为 key 的信号量已经存在,并且它创建时指定的容量小于你指定的 10,要在程序中知道它的容量用 semctl 看一下,不知道怎么用 semctl,man semctl,在 shell 下用 ipcs -s 命令查看。要不然就像楼上说的先删除再创建新的。 |
|