Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 1998 17:41:35 +0200 (SAT)
From:      Graham Wheeler <gram@cdsec.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Shared memory and signals
Message-ID:  <199802021541.RAA07701@cdsec.com>

next in thread | raw e-mail | index | archive | help
Hi all

I was wondering whether it is safe to call shmdt and shmctl from within
a signal handler. I have a program which forks off child processes which
communicate their results back using a shared memory segment. I would like
the parent to detach and release the shared memory from within the SIGCHLD
signal handler, but I'm not sure whether this is safe.

I would also like a SIGTERM signal handler to be able to free any shared
memory segments before exiting. I notice from looking at the kernel source
that it appears as if an exit() effectively does a shmdt for each shared
memory segment, but not a shmctl(IPC_RMID,..). 

Does anyone know if this is safe?

Thanks in advance
Graham
-- 
Dr Graham Wheeler                          E-mail: gram@cdsec.com
Citadel Data Security                      Phone:  +27(21)23-6065/6/7
Internet/Intranet Network Specialists      Mobile: +27(83)-253-9864
Firewalls/Virtual Private Networks         Fax:    +27(21)24-3656
Data Security Products                     WWW:    http://www.cdsec.com/






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802021541.RAA07701>