summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-05-09 08:49:50 -0400
committerAndreas Schneider <asn@samba.org>2011-08-10 18:14:04 +0200
commit3339c9b9b43f4ee1b7f8fb61b3701364b8c81e03 (patch)
treee343e43af74161fdb712c9981ae6a091dfd2f577 /source3
parentde08cd99b2832aca319d81cd27c0c71838567f8d (diff)
downloadsamba-3339c9b9b43f4ee1b7f8fb61b3701364b8c81e03.tar.gz
samba-3339c9b9b43f4ee1b7f8fb61b3701364b8c81e03.tar.bz2
samba-3339c9b9b43f4ee1b7f8fb61b3701364b8c81e03.zip
s3-prefork: provide way to send a signal to all children
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/server_prefork.c14
-rw-r--r--source3/lib/server_prefork.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/server_prefork.c b/source3/lib/server_prefork.c
index 000539da0f..958dc2655e 100644
--- a/source3/lib/server_prefork.c
+++ b/source3/lib/server_prefork.c
@@ -326,6 +326,20 @@ void prefork_reset_allowed_clients(struct prefork_pool *pfp)
}
}
+void prefork_send_signal_to_all(struct prefork_pool *pfp, int signal_num)
+{
+ int i;
+
+ for (i = 0; i < pfp->pool_size; i++) {
+ if (pfp->pool[i].status == PF_WORKER_NONE) {
+ continue;
+ }
+
+ kill(pfp->pool[i].pid, signal_num);
+ }
+}
+
+
/* ==== Functions used by children ==== */
static SIG_ATOMIC_T pf_alarm;
diff --git a/source3/lib/server_prefork.h b/source3/lib/server_prefork.h
index 19ba32dff0..936ad8d5bd 100644
--- a/source3/lib/server_prefork.h
+++ b/source3/lib/server_prefork.h
@@ -72,6 +72,7 @@ int prefork_count_active_children(struct prefork_pool *pfp, int *total);
bool prefork_mark_pid_dead(struct prefork_pool *pfp, pid_t pid);
void prefork_increase_allowed_clients(struct prefork_pool *pfp, int max);
void prefork_reset_allowed_clients(struct prefork_pool *pfp);
+void prefork_send_signal_to_all(struct prefork_pool *pfp, int signal_num);
/* ==== Functions used by children ==== */