r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[sfrench/samba-autobuild/.git] / source3 / include / smb_launchd.h
1 /*
2    Unix SMB/CIFS implementation.
3    Launchd integration wrapper API
4
5    Copyright (C) James Peach 2007
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 struct smb_launch_info
22 {
23         int idle_timeout_secs;
24         int num_sockets;
25         int *socket_list;
26 };
27
28 /* Retrieve launchd configuration. Returns True if we are running under
29  * launchd, False otherwise. NOTE this does not guarantee to provide a list of
30  * sockets since this is a user configuration option.
31  */
32 BOOL smb_launchd_checkin(struct smb_launch_info *linfo);
33
34 /* Retrieve launchd configuration. The variadic arguments are a list of
35  * constant null-terminated strings. The strings are the names of the socket
36  * dictionaries to retrieve sockets from. The list of names is terminated by a
37  * NULL.
38  */
39 BOOL smb_launchd_checkin_names(struct smb_launch_info *linfo, ...);
40
41 /* Free any data or state associated with a successful launchd checkin. */
42 void smb_launchd_checkout(struct smb_launch_info *linfo);