if ( !Bool_val(cloexec) )
flags |= XENEVTCHN_NO_CLOEXEC;
+ result = caml_alloc_custom(&xenevtchn_ops, sizeof(xce), 0, 1);
+
caml_enter_blocking_section();
xce = xenevtchn_open(NULL, flags);
caml_leave_blocking_section();
if (xce == NULL)
caml_failwith("open failed");
- result = caml_alloc_custom(&xenevtchn_ops, sizeof(xce), 0, 1);
*(xenevtchn_handle **)Data_custom_val(result) = xce;
CAMLreturn(result);
CAMLlocal1(result);
xenevtchn_handle *xce;
+ result = caml_alloc_custom(&xenevtchn_ops, sizeof(xce), 0, 1);
+
caml_enter_blocking_section();
xce = xenevtchn_fdopen(NULL, Int_val(fdval), 0);
caml_leave_blocking_section();
if (xce == NULL)
caml_failwith("evtchn fdopen failed");
- result = caml_alloc_custom(&xenevtchn_ops, sizeof(xce), 0, 1);
*(xenevtchn_handle **)Data_custom_val(result) = xce;
CAMLreturn(result);
CAMLlocal1(result);
xc_interface *xch;
+ result = caml_alloc_custom(&xenctrl_ops, sizeof(xch), 0, 1);
+
caml_enter_blocking_section();
xch = xc_interface_open(NULL, NULL, 0);
caml_leave_blocking_section();
if ( !xch )
failwith_xc(xch);
- result = caml_alloc_custom(&xenctrl_ops, sizeof(xch), 0, 1);
*(xc_interface **)Data_custom_val(result) = xch;
CAMLreturn(result);