1 /* 2 * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published 6 * by the Free Software Foundation; version 2.1 only. with the special 7 * exception on linking described in file LICENSE. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 */ 14 15 #include <string.h> 16 #include <stdio.h> 17 #include <stdbool.h> 18 #include <errno.h> 19 #include <caml/mlvalues.h> 20 #include <caml/memory.h> 21 #include <caml/alloc.h> 22 #include <caml/custom.h> 23 #include <caml/signals.h> 24 #include <caml/fail.h> 25 26 #if defined(HAVE_SYSTEMD) 27 28 #include <xen-sd-notify.h> 29 ocaml_sd_notify_ready(value ignore)30CAMLprim value ocaml_sd_notify_ready(value ignore) 31 { 32 CAMLparam1(ignore); 33 34 sd_notify(1, "READY=1"); 35 36 CAMLreturn(Val_unit); 37 } 38 39 #else 40 ocaml_sd_notify_ready(value ignore)41CAMLprim value ocaml_sd_notify_ready(value ignore) 42 { 43 CAMLparam1(ignore); 44 45 CAMLreturn(Val_unit); 46 } 47 #endif 48