只要有文件映射的就可以通过fuser来查看作者: 夜未眠 时间: 2003-06-27 21:43 标题: 如何在程序中获得和共享内存相关联的所有进程号 On My FreeBSD
$ ipcs -mp
Shared Memory:
T ID KEY MODE OWNER GROUP CPID LPID
m 131072 0 --rwarwarwa root wheel 327 327
m 5767169 0 --rw-r--r-- root wheel 327 537
m 11141122 0 --rwarwarwa lyx wheel 1166 327
m 5701636 0 --rw-r--r-- root wheel 327 1166
$
/usr/src/usr.bin/ipcs have source code. read it by yourself作者: 夜未眠 时间: 2003-06-27 22:35 标题: 如何在程序中获得和共享内存相关联的所有进程号 i am sorry that doesn't understand your mean first time.sorry.sorry.
i don't know how to doit.i think list are manage by kernel,couldn't read it by process.作者: gadfly 时间: 2003-06-28 13:16 标题: 如何在程序中获得和共享内存相关联的所有进程号 swap可以通过statfs来查看吧。
至于共享内存的attach个数可以通过,shmctl(segId, IPC_STAT, &ds);取struct shmid_ds ds的成员
unsigned short int shm_nattch; /* number of current attaches */
来获得。