ipcs - provide information on ipc facilities DESCRIPTION ipcs provides information on the ipc facilities for which the calling process has read access. The -i option allows a specific resource id to be specified. Only information on this id will be printed. Resources may be specified as follows: -m shared memory segments -q message queues -s semaphore arrays -a all (this is the default) The output format may be specified as follows: -t time -p pid 图片" src="http://img.jb51.cc/vcimg/static/loading.png" style="margin:0px;padding:0px;border-width:0px;border-style:none;vertical-align:top;width:770px;height:174px;" src="http://r.photo.store.qq.com/psb?/V11qXNRe1rKw0v/NkArGXu4DfIy9rPVp97p1ZA992Tz.*7mTcOPVYQ468I!/o/dLAAAAAAAAAA&ek=1&kp=1&pt=0&bo=AgOuAAIDrgADACU!&su=1167030577&tm=1481493600&sce=0-12-12&rf=2-9"> key栏中列出的信息是应用程序定义的键值,如果是私有对象的键值则为0,在这里我们定义键值为12345678,也就是输出的0x00bc614e(十六进制) 在上面的输出中,我们没有看到smem用到的共享内存有dest的状态,而此时我们用ipcrm -m 18874397手工删除该段共享内存时,此时该段的共享内存键值将会是0x00000000(IPC_PRIVATE),而程序通过调用shmdt来释放该段共享内存时,这段共享内存才会真正的消失. |