如何在FreeBSD中获取打开的posix共享内存段列表

在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).