在 linux 中,我可以通过获取 /dev/shm 目录列表来获取打开的 posix 共享内存段的列表。
我如何以编程方式获取 FreeBSD 中所有打开的 posix 共享内存段的列表?
假设使用 shm_open()
打开的段,我什至不知道用作 shm_open()
第一个参数的名称的一部分。
最佳答案
你不能。请参阅/sys/kern/uipc_shm.c 中的注释:
* TODO:
*
* (2) Need to export data to a userland tool via a sysctl. Should ipcs(1)
* and ipcrm(1) be expanded or should new tools to manage both POSIX
* kernel semaphores and POSIX shared memory be written?
*
* (3) Add support for this file type to fstat(1).
关于c - 如何在 FreeBSD 中获取打开的 posix 共享内存段列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12430351/