Hi,

I have a question concerning a foreign function which is supposed to 
write to a Unix stream/file.

The signature of the C function is:

   void print_prolog_graph(FILE *stream);

My foreign function is defined as:

   (def-alien-routine "print_prolog_graph" void
        (stream :ptr))

I am trying to pass the file stream's SAP object to the ff, but this 
does not work. Nothing is written to the stream, and sometimes I get 
a segmentation fault:

   (with-open-file (stream "temp.lisp" :direction :output :if-exists :supersede)
       (print-prolog-graph (common-lisp::fd-stream-obuf-sap stream)))

Any idea how to do this right?

Cheers, Paul

Reply via email to