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_")]
26 public enum LogFlags {
33 [CCode (cname = "int", cprefix = "LOG_")]
34 public enum LogPriority {
45 [CCode (cname = "int", cprefix = "SIG")]
84 public int exec (string dir, out int ret, string prog, ...);
87 public int retval_init ();
88 public void retval_done ();
89 public int retval_wait (int timeout);
90 public int retval_send (int s);
91 public int close_all (int except_fd, ...);
92 public int close_allv ([CCode (array_length = false)] int[] except_fds);
93 public int unblock_sigs (int except, ...);
94 public int unblock_sigsv ([CCode (array_length = false)] int[] except);
95 public int reset_sigs (int except, ...);
96 public int reset_sigsv ([CCode (array_length = false)] int[] except);
98 public static LogFlags log_use;
99 public static string log_ident;
101 public void log (int prio, string t, ...);
102 public weak string ident_from_argv0 (string argv0);
104 public int nonblock (int fd, int b);
106 public delegate string PidFileProc ();
108 public static string pid_file_ident;
109 public static PidFileProc pid_file_proc;
111 public weak string pid_file_proc_default ();
112 public int pid_file_create ();
113 public int pid_file_remove ();
114 public int pid_file_is_running ();
115 public int pid_file_kill (Sig s);
116 public int pid_file_kill_wait (Sig s, int m);
118 public int signal_init (Sig s, ...);
119 public int signal_install (Sig s);
120 public void signal_done ();
121 public int signal_next ();
122 public int signal_fd ();