summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-04-20 21:09:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:33 -0500
commit44f5211c170c0ddc2be23717f1ad08f5fc0b329a (patch)
tree36758905a0cdb7df1a63381d7380c77192ff78f1 /source3/include
parent8a22b1f0ea81f06616a2dc41a138c5126359f009 (diff)
downloadsamba-44f5211c170c0ddc2be23717f1ad08f5fc0b329a.tar.gz
samba-44f5211c170c0ddc2be23717f1ad08f5fc0b329a.tar.bz2
samba-44f5211c170c0ddc2be23717f1ad08f5fc0b329a.zip
r22418: Support running under launchd. We abstract the method of obtaining
sockets to listen on a little, because in the launchd case these are provided for us. We also add an idle timeout so that a daemon can exit after a period of inactivity. (This used to be commit fc8589a3371d396197fae508e563f814899c2beb)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smb_launchd.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/source3/include/smb_launchd.h b/source3/include/smb_launchd.h
new file mode 100644
index 0000000000..2e758a4de1
--- /dev/null
+++ b/source3/include/smb_launchd.h
@@ -0,0 +1,43 @@
+/*
+ Unix SMB/CIFS implementation.
+ Launchd integration wrapper API
+
+ Copyright (C) James Peach 2007
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+struct smb_launch_info
+{
+ int idle_timeout_secs;
+ int num_sockets;
+ int *socket_list;
+};
+
+/* Retrieve launchd configuration. Returns True if we are running under
+ * launchd, False otherwise. NOTE this does not guarantee to provide a list of
+ * sockets since this is a user configuration option.
+ */
+BOOL smb_launchd_checkin(struct smb_launch_info *linfo);
+
+/* Retrieve launchd configuration. The variadic arguments are a list of
+ * constant null-terminated strings. The strings are the names of the socket
+ * dictionaries to retrieve sockets from. The list of names is terminated by a
+ * NULL.
+ */
+BOOL smb_launchd_checkin_names(struct smb_launch_info *linfo, ...);
+
+/* Free any data or state associated with a successful launchd checkin. */
+void smb_launchd_checkout(struct smb_launch_info *linfo);