【发布时间】:2020-06-03 13:33:08
【问题描述】:
当我创建共享内存(Linux 中的 c 程序)时,我使用 shmctl(shmid, IPC_RMID, 0) 将其删除,当我使用 ipcs -m 检查是否还有剩余的共享内存段时,一切看起来都很好。但我想知道如何删除我在程序终止之前创建的信号量,因为当我使用 ipcs -s 时,我看到我的两个信号量都在那里,结果:
------ Semaphore Arrays --------
key semid owner perms nsems
0x6b014021 0 benjamin 600 1
0x6c014021 1 benjamin 600 1
谢谢。
【问题讨论】:
-
你能提供你的代码吗?
标签: c linux semaphore shared-memory free