[erlang-questions] Linked-in drivers: output and outputv callbacks

Joel Reymont joelr1@REDACTED
Thu Dec 13 20:15:39 CET 2007


I'm studying the source for the efile driver in efile_drv.c as well as  
the matching Erlang code in prim_file.erl.

For the life of me I cannot figure out how FILE_WRITE gets to be  
handled in file_outputv and FILE_MKDIR in file_output. Both are  
triggered from port_command/2 on the Erlang side and both callbacks  
are set in the driver entry structure.

How does the runtime figure out whether to call the output callback or  
the outputv callback when both are supplied?

According to erts_write_to_port in erts/emulator/beam/io.c, the output  
callback will never be called when the output callback is present the  
function checks for outputv first.

	Thanks, Joel

--
http://wagerlabs.com








More information about the erlang-questions mailing list