Re: Swappability of shared memory

Gerd Knorr (kraxel@goldbach.isdn.cs.tu-berlin.de)
Thu, 28 Aug 1997 09:29:15 +0200


>Second: Is it possible to somehow determine what sysV ipc primitives
>are in use (for example to destroy shared memory allocated by
>already-dead processes etc.)? Hmm, I found syscall (shmctl) but I
>would like utility...

The GIMP (image processing program which uses shared memory much)
comes with such a utility.

Gerd

--------------------------------------------------------
#!/bin/sh
#
# title: rmshm
# author: Spencer Kimball
#
# This script remove all shared memory segments from the system.
#

IPCS="ipcs -m"
IPCRM="ipcrm shm"

shared_mem_ids=`$IPCS | sed 1,3d | awk '{print $1}'`

echo Removing shared memory segments:
for id in $shared_mem_ids ; do
echo -n "$id "
$IPCRM $id
done