summaryrefslogtreecommitdiff
path: root/source3/lib/server_prefork_util.h
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-12 15:24:17 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:04 -0400
commit3451f423d6a70da054c06135bc36daf0677b53f9 (patch)
treee312bddd5e11ff55a74624a213ccafd205325ce1 /source3/lib/server_prefork_util.h
parent0647a93c64ce5d87527d6c9e34688f93e7cd03b3 (diff)
downloadsamba-3451f423d6a70da054c06135bc36daf0677b53f9.tar.gz
samba-3451f423d6a70da054c06135bc36daf0677b53f9.tar.bz2
samba-3451f423d6a70da054c06135bc36daf0677b53f9.zip
s3-prefork: Add common utilities for daemons
Daemons using the prefork infrastructure may want to use these utils to configure and manage a pool of children. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/lib/server_prefork_util.h')
-rw-r--r--source3/lib/server_prefork_util.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/source3/lib/server_prefork_util.h b/source3/lib/server_prefork_util.h
new file mode 100644
index 0000000000..5715f06f4a
--- /dev/null
+++ b/source3/lib/server_prefork_util.h
@@ -0,0 +1,49 @@
+/*
+ Unix SMB/CIFS implementation.
+ Prefork Helpers.
+
+ Copyright (C) Simo Sorce <idra@samba.org> 2011
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _SERVER_PREFORK_UTIL_H_
+#define _SERVER_PREFORK_UTIL_H_
+
+struct tevent_context;
+struct messaging_context;
+
+#define PFH_INIT 0x00
+#define PFH_NEW_MAX 0x01
+#define PFH_ENOSPC 0x02
+
+struct pf_daemon_config {
+ int prefork_status;
+ int min_children;
+ int max_children;
+ int spawn_rate;
+ int max_allowed_clients;
+ int child_min_life;
+};
+
+void pfh_daemon_config(const char *daemon_name,
+ struct pf_daemon_config *cfg,
+ struct pf_daemon_config *default_cfg);
+
+void pfh_manage_pool(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
+ struct pf_daemon_config *cfg,
+ struct prefork_pool *pool);
+
+#endif /* _SERVER_PREFORK_UTIL_H_ */