summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-11-05 15:45:52 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-11-05 15:45:52 +0000
commit8f14a11301ef4c58ae9da28a6441dbb21557d56c (patch)
tree42e407bef4e4e324d941fba30d353ed4baabfc90
parent5c8426d50e255a317b9ab4586776f238ad2154ae (diff)
downloadcygnal-8f14a11301ef4c58ae9da28a6441dbb21557d56c.tar.gz
cygnal-8f14a11301ef4c58ae9da28a6441dbb21557d56c.tar.bz2
cygnal-8f14a11301ef4c58ae9da28a6441dbb21557d56c.zip
* bsd_helper.cc (tunable_params): Add kern.ipc.shm_allow_removed as
bool parameter. * cygserver.conf: Add a description for the kern.ipc.shm_allow_removed parameter. * sysv_shm.cc (shminit): Set shm_allow_removed variable according to kern.ipc.shm_allow_removed setting.
-rw-r--r--winsup/cygserver/ChangeLog9
-rw-r--r--winsup/cygserver/bsd_helper.cc1
-rw-r--r--winsup/cygserver/cygserver.conf6
-rw-r--r--winsup/cygserver/sysv_shm.cc6
4 files changed, 20 insertions, 2 deletions
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog
index f52d1569a..1aea84407 100644
--- a/winsup/cygserver/ChangeLog
+++ b/winsup/cygserver/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * bsd_helper.cc (tunable_params): Add kern.ipc.shm_allow_removed as
+ bool parameter.
+ * cygserver.conf: Add a description for the kern.ipc.shm_allow_removed
+ parameter.
+ * sysv_shm.cc (shminit): Set shm_allow_removed variable according to
+ kern.ipc.shm_allow_removed setting.
+
2007-08-02 Corinna Vinschen <corinna@vinschen.de>
* smallprint.c: Remove.
diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc
index f88398ea1..9c6b191c1 100644
--- a/winsup/cygserver/bsd_helper.cc
+++ b/winsup/cygserver/bsd_helper.cc
@@ -582,6 +582,7 @@ static tun_struct tunable_params[] =
//{ "kern.ipc.shmmin", TUN_INT, {0}, {1}, {32767}, default_tun_check},
{ "kern.ipc.shmmni", TUN_INT, {0}, {1}, {32767}, default_tun_check},
{ "kern.ipc.shmseg", TUN_INT, {0}, {1}, {32767}, default_tun_check},
+ { "kern.ipc.shm_allow_removed", TUN_BOOL, {TUN_UNDEF}, {TUN_FALSE}, {TUN_TRUE}, default_tun_check},
//{ "kern.ipc.shm_use_phys", TUN_INT, {0}, {1}, {32767}, default_tun_check},
{ NULL, TUN_NULL, {0}, {0}, {0}, NULL}
};
diff --git a/winsup/cygserver/cygserver.conf b/winsup/cygserver/cygserver.conf
index c224c0e4c..589931b11 100644
--- a/winsup/cygserver/cygserver.conf
+++ b/winsup/cygserver/cygserver.conf
@@ -139,3 +139,9 @@
# kern.ipc.shmseg: Maximum number of shared memory segments per process.
# Default: 128, Min: 1, Max: 32767
#kern.ipc.shmseg 128
+
+# kern.ipc.shm_allow_removed: Determines whether a process is allowed to
+# attach to a shared memory segment (using the shmat call) after a successful
+# call to shmctl(IPC_RMID). This is a Linux-specific, and therefore
+# non-portable feature. Use with care. Default is "no".
+#kern.ipc.shm_allow_removed no
diff --git a/winsup/cygserver/sysv_shm.cc b/winsup/cygserver/sysv_shm.cc
index 88ddae033..700dbe21d 100644
--- a/winsup/cygserver/sysv_shm.cc
+++ b/winsup/cygserver/sysv_shm.cc
@@ -952,6 +952,7 @@ void
shminit(void)
{
int i;
+ tun_bool_t shm_ar;
TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall);
for (i = PAGE_SIZE; i > 0; i--) {
@@ -962,8 +963,9 @@ shminit(void)
TUNABLE_INT_FETCH("kern.ipc.shmmin", &shminfo.shmmin);
TUNABLE_INT_FETCH("kern.ipc.shmmni", &shminfo.shmmni);
TUNABLE_INT_FETCH("kern.ipc.shmseg", &shminfo.shmseg);
- TUNABLE_INT_FETCH("kern.ipc.shm_use_phys", &shm_use_phys);
-
+ TUNABLE_BOOL_FETCH("kern.ipc.shm_allow_removed", &shm_ar);
+ if (shm_ar == TUN_TRUE)
+ shm_allow_removed = 1;
shmalloced = shminfo.shmmni;
shmsegs = (struct shmid_ds *) sys_malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK);
if (shmsegs == NULL)