本文介绍了如何在FreeBSD中获取开放的posix共享内存段的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux中,我可以通过获取/dev/shm目录列表来获取已打开的posix共享内存段的列表.

In linux i can get list of opened posix shared memory segments by getting /dev/shm directory listing.

我如何以编程方式获取FreeBSD中所有打开的posix共享内存段的列表?假设使用shm_open打开了句段,而我甚至都不知道用作shm_open的第一个参数的名称的一部分.

How do i programmatically get list of all opened posix shared memory segments in FreeBSD?Assuming segments opened with shm_open and i don't know even a part of a name that was used as a first argument of shm_open.

推荐答案

您不能.请参阅/sys/kern/uipc_shm.c中的注释:

You can't. See the comment in /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).

这篇关于如何在FreeBSD中获取开放的posix共享内存段的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 19:03