Subject: Re: [clisp-list] sigaction for linux.lisp - GOT IT

From: Peter Wood <[email-masked]>
Date: Tue Mar 12 06:54:09 2002

Hi,

On Tue, Mar 12, 2002 at 09:28:53AM +0100, Hoehle, Joerg-Cyril wrote:
> Peter,
> now I'm confused.

My apologies.

> 
> >              (act (c-ptr-null sigaction) :in :alloca)
> This is exactly the replacement I meant.
> It doesn't work?
>

It does.  oops.  
 
> 
> > But this does:
> > 
> >  (def-c-call-out sigaction-new-or-query
> >    (:name "sigaction")
> >    (:arguments (sig int)
> >                (act (c-ptr-null nil) :in :alloca)
> >                (null c-string))
> >    (:return-type int))
> How can this work as sigaction-new? You cannot pass in a new sigaction structure.
> 

It just sets the handler to nil.  Sorry. It was late when I wrote the
mail, and I had tested it only as far as calling the function.  I did
not check to see that the handler was actually installed.

> > And the reason I was getting the error message described, was that I
> > had forgotten to add c-ptr-null to the list of substitutions in
> > linux.lisp.
> ??
> 

In linux.lisp, there is a constant 'substitution' which is a list
pairing functions in "LINUX" with a substitution in "LISP" or "FFI".
It looks like this:

(eval-when (compile-eval)
  (defconstant substitution
   '((linux::aref . lisp:aref)
     ..etc..
     (linux::c-ptr . ffi:c-ptr)
     ..etc..)))

There was none for c-ptr-null.  I have just rechecked that.  You will
also find that there is no use of c-ptr-null in linuxlibc6.  I have
just recompiled linux.lisp without the substitution for c-ptr-null,
and I get the old error.  With a line for c-ptr-null, the error
disappears.

> Regards,
> 	Jorg Hohle. 

Regards,
Peter