Matthew, this is more or less what you said before, but the examples I have been working at here in my laptop they all work without segfaults.<div><br></div><div>faa.lisp:</div><div><br></div><div><div>(ffi::clines "#include <fcntl.h>")</div>
<div><br></div><div>(defun make-stream (filename)</div><div> (let ((f (namestring filename)))</div><div> (ffi:c-inline (f) (:object) :object "</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>cl_object file = #0;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>int fd = open(file->base_string.self, O_RDONLY, mode);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>printf(\";; File descriptor %d for %s\", fd, file->base_string.self);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>@(return) = ecl_make_stream_from_fd(file, fd, smm_input,</div>
<div> 8, 0, @:default);</div><div>}"</div><div> :one-liner nil)))</div><div><br></div><div>(format t "~%;; File descriptor is ~D"</div><div> (si::file-stream-fd (make-stream "~/.profile")))</div>
<div><br></div><div><div>> (compile-file "faa" :load t)</div><div><br></div><div>[...]</div><div>;; File descriptor 9 for /Users/jjgarcia/.profile</div><div>;; File descriptor is 9</div><div><br></div></div><div>
<br></div><div class="gmail_quote">On Sun, Mar 21, 2010 at 12:01 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi again,<br>
<br>
The debugger enters because of a segmentation fault when using the<br>
functions SI:FILE-STREAM-FD or GRAY:STREAM-FILE-DESCRIPTOR on a stream<br>
previously created using ecl_make_stream_from_fd() (which is otherwise<br>
working fine).<br>
<br>
Thanks,<br>
--<br>
Matt<br>
<br>
------------------------------------------------------------------------------<br>
Download Intel® Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net" target="_blank">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://tream.dreamhosters.com" target="_blank">http://tream.dreamhosters.com</a><br>
</div>