Hi,
In comp.lang.lisp,
Message-ID: <A25ne.37217$6k7...@bi...>
RC <otq...@pv...> wrote on March, 31st:
>I also found that if you build CLISP with
>--with-module=bindings/glibc
>then you get the function (unix:getpid) included
>but it's only working under linux. With Freebsd
>you get errors about bits/errno.h not being found.
Similarly, in clisp-list R. Mattes [rm...@mh...] writes:
"on my Linux/PPC box"
> /usr/local/src/LISP/DEBS/clisp/build/bindings/glibc/linux.fas ... *** -
> FFI::LOOKUP-FOREIGN-FUNCTION: A foreign function "__errno_location" does
> not exist
o Is FreeBSD also a glibc system, i.e. can one on *BSD expect to load the linux.lisp module? (note that --module=bindings/glibc does not say "linux", or is that synonym?)
o In my answer in clisp-list I had the following possible alternative in mind:
in foreign.d:init_ffi()
#ifndef THREADS
register_foreign_variable("errno or_any_other suitable name",&errno,...);
# IIRC, &errno is supported by the cpp macro that turns it to errno_location
# Otherwise, maybe that's needed:
#if defined(errno) && some GLIBC tests
register_foreign_variable("errno or_any_other suitable name",__errno_location(),...);
#else
register_foreign_variable("errno or_any_other suitable name",&errno,...);
#endif
#endif
in linux.lisp
#-MT
(eval-when (eval load) ; prevent the compiler from emitting fvar code
; just declare it at run/load time.
(def-c-var errno (:name "errno or_any_other suitable name") int))
With threads, the current errno_location is probably needed.
What do you think about such a change? It is intended to fix the portability problems people have reported about linux.lisp/errno.
Regards,
Jorg Hohle.
|