3 * Copyright (C) 2009 Jukka-Pekka Iivonen
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jukka-Pekka Iivonen <jp0409@jippii.fi>
23 [CCode (lower_case_cprefix = "daemon_", cheader_filename = "signal.h,libdaemon/daemon.h")]
25 [CCode (cname = "int", cprefix = "DAEMON_LOG_", has_type_id = false)]
26 public enum LogFlags {
33 [CCode (cname = "int", cprefix = "LOG_", has_type_id = false)]
34 public enum LogPriority {
45 [CCode (cname = "int", cprefix = "SIG", has_type_id = false)]
84 public int exec (string dir, out int ret, string prog, ...);
87 public Posix.pid_t fork ();
89 public GLib.Pid fork ();
91 public int retval_init ();
92 public void retval_done ();
93 public int retval_wait (int timeout);
94 public int retval_send (int s);
95 public int close_all (int except_fd, ...);
96 public int close_allv ([CCode (array_length = false)] int[] except_fds);
97 public int unblock_sigs (int except, ...);
98 public int unblock_sigsv ([CCode (array_length = false)] int[] except);
99 public int reset_sigs (int except, ...);
100 public int reset_sigsv ([CCode (array_length = false)] int[] except);
102 public static LogFlags log_use;
103 public static string log_ident;
105 public void log (int prio, string t, ...);
106 public unowned string ident_from_argv0 (string argv0);
108 public int nonblock (int fd, int b);
110 public delegate string PidFileProc ();
112 public static string pid_file_ident;
113 public static PidFileProc pid_file_proc;
115 public unowned string pid_file_proc_default ();
116 public int pid_file_create ();
117 public int pid_file_remove ();
119 public Posix.pid_t pid_file_is_running ();
121 public GLib.Pid pid_file_is_running ();
123 public int pid_file_kill (Sig s);
124 public int pid_file_kill_wait (Sig s, int m);
126 public int signal_init (Sig s, ...);
127 public int signal_install (Sig s);
128 public void signal_done ();
129 public int signal_next ();
130 public int signal_fd ();