[erlang-questions] driver_output works, driver_output_term doesn't

John M. Nordgaard <>
Mon Jan 21 00:32:23 CET 2008


Hi all,

I have written a small linked-in driver which needs to return some fairly
complex data. So I'd like to use driver_output_term for the job.

However, I cannot get it to work. More precisely, I never receive a
response from the C code, even when running this simple example:

  ErlDrvTermData t[] = { ERL_DRV_ATOM, driver_mk_atom("unknown") };
  driver_output_term(dd->port, t, size(t) / size(t[0]));

On the Erlang side 'receive' simply hangs. Strange thing is, replacing the
above with the following code I do in fact receive a response of [0]:

  char res = 0;
  driver_output(dd->port, &res, 1);

It would seem that dd->port as such should be off the hook at this point,
given that it works for 'driver_output'. Question is, am I wrong? Or is
there any other reason why 'driver_output_term' would not work, perhaps a
missing control flag or some other form of setting?

My system is Gentoo Linux amd64, running 12B-0 with hipe.

All suggestions appreciated! :-)

- john.





More information about the erlang-questions mailing list