|
From: Sam S. <sd...@gn...> - 2005-06-06 18:46:16
|
> * Hoehle, Joerg-Cyril <Wbr...@g-...> [2005-06-03 12:52:42 +0200]:
>
>
> o Is FreeBSD also a glibc system,
no, they do not use GNU libc, they use BSD libc
> 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?)
maybe.
> 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.
we can do it more easily:
foreign.d:int * clisp_errno_location (void) { return &errno; }
> What do you think about such a change? It is intended to fix the
> portability problems people have reported about linux.lisp/errno.
... and also add some interesting tests to tests/ffi.tst
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://pmw.org.il/> <http://ffii.org/> <http://www.jihadwatch.org/>
<http://www.palestinefacts.org/> <http://www.mideasttruth.com/>
In every non-trivial program there is at least one bug.
|