Re: CLISP on Haiku

Bruno Haible via clisp-devel <[email protected]> Wed, 08 Jan 2025 17:03:59 +0100
Newsgroups gmane.lisp.clisp.devel
Organization GNU
Message-ID <8272870.JRmrKFJ9eK@nimes>
Alexandru Popa wrote:
> Haiku does not consider this a bug. There is nothing to "solve" in Haiku.

I don't know where you got this information from. Socket behaviour is
generally specified by POSIX, and the Haiku bug tracker has a category
"System/POSIX".

To show you how to report deviations from POSIX, I entered this one:
https://dev.haiku-os.org/ticket/19347

> Different OSes behave differently. Haiku instead of some error uses a more
> general one.

This is likely a bug w.r.t. POSIX as well: POSIX specifes which error code
is used in which case. Search for ESOCKTNOSUPPORT in
https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html
https://pubs.opengroup.org/onlinepubs/9799919799/functions/socket.html
If you find that Haiku does not behave like this (it most likely doesn't,
since it does not even have the definition of ESOCKTNOSUPPORT), please report
a bug.

> The OS specific patches are available in almost all OSes:
> *BSD, Solaris / Indiana, Windows (of course) etc.

But we want to have as few conditionals in the code as possible. While
it is unlikely that bug reports from us could change the mind of the *BSD
people (sockets were first defined by BSD, after all), we should do that
w.r.t. Haiku.

> I would prepare the patch myself, jest let me know where to start. What
> file(s) to consider.

CLISP has two socket facilities: a higher-level one in src/socket.d, and a
lower-level on in module rawsock. Which one you need to fix for e.g. SLIME
to work, I cannot tell. Note that src/socket.d does NOT use rawsock; rawsock
really is separate.

> I found the definition of function
> RAWSOCK:MAKE-SOCKADDR in modules/rawsock/rawsock.c in lines 255-279. This
> file seems to be C source, which resembles Common Lisp structure (is
> &optional somehow handled in C?).

Yes. &optional is handled through the missingp() macro.

> I just cannot find any error definitions
> and handling, maybe this is up to underlying OS 3rd party libraries.

The 'define-condition' invocations at the end of rawsock/sock.lisp ?

> Can you guide me (probably by pointing to relevant documentation) in the
> following:
> - What is the architecture of CLISP modules?

See https://clisp.sourceforge.io/impnotes.html#modules

> I see many of them use some
> glue C code. What is its purpose? How it is used?

See https://clisp.sourceforge.io/impnotes.html#modprep

> I see the tool
> clisp-link, which seems to be related to modules loading (or
> installation?). How it is used?

See https://clisp.sourceforge.io/clisp-link.html

> - Which existing rawsock tests can I use? I see rawsock/test.tst seems to
> be Common Lisp code. Does its loading starts some tests or just defines
> some specific functions for testing?

I don't know. Generally, my advice would be to try things on Linux or FreeBSD
first, and then only see whether Haiku behaves differently.

> I also see
> modules/rawsock/demos/sniffer.lisp. Can it be used for debugging / testing?

It's marked as a demo. So it might be useful for limited-scope testing. Maybe.

Bruno





_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel