> On Jan 29, 2024, at 9:23 PM, Eric Wong <e...@80x24.org> wrote:
> 
> While syscall symbols (e.g. SYS_*) have changed on us in FreeBSD
> during the history of Sys::Syscall and this project and did bite
> us in some cases; the actual numbers don't get recycled for new
> syscalls.  We're also fortunate that sendmsg and recvmsg syscalls
> and associated msghdr and cmsg structs predate the BSD forks and
> are compatible across all the BSDs I've tried.
> 
> OpenBSD routes Perl `syscall' through libc; while NetBSD + FreeBSD
> document procedures for maintaining backwards compatibility.
> It looks like Dragonfly follows FreeBSD, here.
> 
> Tested on i386 OpenBSD, and amd64 {Free,Net,Open,Dragonfly}BSD
> 
> This enables *BSD users to use lei, -cindex and future SCM_RIGHTS-only
> features without needing Inline::C.

Unfortunately this patch broke public-inbox on Darwin:

Bareword "SIZEOF_cmsghdr" not allowed while "strict subs" in use at 
/tmp/public-inbox/lib/PublicInbox/Syscall.pm line 456.
BEGIN not safe after errors--compilation aborted at 
/tmp/public-inbox/lib/PublicInbox/Syscall.pm line 460.
Compilation failed in require at /tmp/public-inbox/lib/PublicInbox/DS.pm line 
31.
BEGIN failed--compilation aborted at /tmp/public-inbox/lib/PublicInbox/DS.pm 
line 32.
Compilation failed in require at /tmp/public-inbox/lib/PublicInbox/Daemon.pm 
line 17.
BEGIN failed--compilation aborted at 
/tmp/public-inbox/lib/PublicInbox/Daemon.pm line 17.
Compilation failed in require at /tmp/public-inbox/script/public-inbox-httpd 
line 7.
BEGIN failed--compilation aborted at 
/tmp/public-inbox/script/public-inbox-httpd line 7.

I’m not enough of a Perl person to fully untangle this. As
best I can tell, the intent is that non-Linux/BSD OSes should
still work with Inline::C, but this doesn’t work in practice
due to a bug?

It may also be possible to use the BSD approach on Darwin -
Darwin ascribes to the BSD school of thought where libc is the
only Officially Stable interface, but if you can get away with
it on the real BSDs maybe you can get away with it on fake BSD
too.

Best wishes,
Gaelan

Reply via email to