- proc_nrv = Val_int (proc_nr);
- serialv = Val_int (serial);
- positionv = caml_copy_int64 (position);
- totalv = caml_copy_int64 (total);
+ root = guestfs_get_private (g, "_ocaml_g");
+ gv = *root;
+
+ /* Only one bit should be set in 'event'. Which one? */
+ evv = Val_int (event_bitmask_to_event (event));
+
+ ehv = Val_int (event_handle);
+
+ bufv = caml_alloc_string (buf_len);
+ memcpy (String_val (bufv), buf, buf_len);
+
+ arrayv = caml_alloc (array_len, 0);
+ for (i = 0; i < array_len; ++i) {
+ v = caml_copy_int64 (array[i]);
+ Store_field (arrayv, i, v);
+ }