列出 AIX5.3 上进程使用的所有共享内存段

发布于 2024-08-18 14:52:01 字数 282 浏览 5 评论 0原文

我想找到给定进程使用的所有共享内存段。我对找出 shmid 特别感兴趣,这样我就可以在调用 shmctl() 时使用它。

在 Solaris 上,我只需读取 /proc/$PID/map 即可找出该信息(字段 pr_shmid)。 该文件的内容由 sys/procfs 中的 struct prmap_t 定义。

AIX 还有一个 /proc/$PID/map 文件。还有一个 struct prmap,但不幸的是它缺少 pr_shmid 字段。

我有什么想法可以在 AIX5.3+ 上实现这一点吗?

I would like to find all shared memory segments used by a given process. I am especially interested in figuring out the shmid so i can use it in calls to shmctl().

On Solaris i would just read /proc/$PID/map to figure out that information (field pr_shmid).
The contents of that file are defined by struct prmap_t in sys/procfs.

AIX also has a /proc/$PID/map file. There is also a struct prmap but unfortunately it is missing the pr_shmid field.

Any ideas how i can achieve this on AIX5.3+?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

本宫微胖 2024-08-25 14:52:01

我对 AIX 不太了解,但我认为 ipcs 命令在支持 SysV IPC 的情况下是相当标准的,所以我希望 ipcs -m 命令能够提供适当的信息;如果您找不到更好的方法,则解析其输出可能是一种选择。

I don't know about AIX in particular, but I think the ipcs command is fairly standard where SysV IPC is supported, so I'd expect the ipcs -m command to give the appropriate information; parsing the output of that might be an option, if you can't find a better way.

挽容 2024-08-25 14:52:01

svmon -P 将按类型列出进程内存段。

您还可以使用 -S 查看某个段附加了哪些 PID。使用 -S,首先运行 ipcs -bmS,然后获取不带 0x 的 SID,并将其与

svmon -lS [SID]

一起使用,这将返回附加的 PID。

svmon -P will list the process memory segments by type.

You can also use -S to see what PIDs are attached to a segment. with -S, first run ipcs -bmS, then take the SID w/o the 0x, and use it with

svmon -lS [SID]

That will return the PIDs attached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文