Re: RFC: ENOSYS vs SIGSYS for FreeBSD ABIs
Warner Losh <[email protected]> Sun, 19 Apr 2026 10:55:22 -0600
| Newsgroups | gmane.os.freebsd.architechture |
|---|---|
| Message-ID | <CANCZdfr_EEw_zdUMh-WO1R+pMjJ+ECaedz0LF=KipG76C3yS5w@mail.gmail.com> |
--000000000000ed5f07064fd30c6d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 18, 2026 at 2:02=E2=80=AFPM Poul-Henning Kamp <[email protected].= dk> wrote: > -------- > John Baldwin writes: > > > From what I can tell though, while POSIX documents both ENOSYS and > SIGSYS, > > it does not document the semantics of these (and the one reference I > could > > find to SIGSYS specifically noted that the semantics aren't documented > since > > there aren't any consistent semantics across systems). > > The explanation I heard many years ago, is that SIGSYS was supposed > to make it possible to emulate system-calls in userland, with some > hand-wavy mumbling about pre-shlib binaries not having to know if > you had bought a STREAMS based or socket(2) based network-add-on > product. > > To me that sounded like precisely the kind of thing the commercial > UNIX vendors agree on in the late 1980ies, so it satisfied my curiosity. > > Any of Sam, Kirk, Eric or TUHS would be a more credible source. > Yea, I was going to do a deep dive in into V7, talk about how SIGEMT allowed RT11 binaries to run, etc, but I'm highly skeptical that a pre-load shim could work since many programs reset segnal handlers to default just to be safe. I thought the reason was more prosaic: we don't trust programs to error check so when a bad system call is made, we kill them. Bad bit of policy, but I suspect that's the real reason > > On the other side, I have _never_ had SIGSYS be an aid. It's only gott= en > > in the way. > > +1 > Same. Though with the caveat that I'm not sure how our massive system call changes would have gone in the past. I think that some would be fine, other would just fail entirely depending on how critical the new system call was. Hopefully, it would have been 'fine enough' to recover, much like using libfoo.so.10 when libfoo.so.11 comes out. Warner --000000000000ed5f07064fd30c6d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Apr 18,= 2026 at 2:02=E2=80=AFPM Poul-Henning Kamp <<a href=3D"mailto:[email protected]= eebsd.dk">[email protected]</a>> wrote:<br></div><blockquote class=3D"g= mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204= ,204,204);padding-left:1ex">--------<br> John Baldwin writes:<br> <br> > From what I can tell though, while POSIX documents both ENOSYS and SIG= SYS,<br> > it does not document the semantics of these (and the one reference I c= ould<br> > find to SIGSYS specifically noted that the semantics aren't docume= nted since<br> > there aren't any consistent semantics across systems).<br> <br> The explanation I heard many years ago, is that SIGSYS was supposed<br> to make it possible to emulate system-calls in userland, with some<br> hand-wavy mumbling about pre-shlib binaries not having to know if<br> you had bought a STREAMS based or socket(2) based network-add-on<br> product.<br> <br> To me that sounded like precisely the kind of thing the commercial<br> UNIX vendors agree on in the late 1980ies, so it satisfied my curiosity.<br= > <br> Any of Sam, Kirk, Eric or TUHS would be a more credible source.<br></blockq= uote><div><br></div><div>Yea, I was going to do a deep dive in into V7, tal= k about how SIGEMT</div><div>allowed=C2=A0RT11 binaries to run, etc, but I&= #39;m highly skeptical that a pre-load</div><div>shim could work since many= programs reset segnal handlers to default</div><div>just to be safe.</div>= <div><br></div><div>I thought the reason was more prosaic: we don't tru= st programs to error check</div><div>so when a bad system call is made, we = kill them. Bad bit of policy, but I</div><div>suspect that's the real r= eason</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"marg= in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e= x"> > On the other side, I have _never_ had SIGSYS be an aid.=C2=A0 It's= only gotten<br> > in the way.<br> <br> +1<br></blockquote><div><br></div><div>Same.=C2=A0 Though with the caveat t= hat I'm not sure how our massive system call</div><div>changes would ha= ve gone in the past. I think that some would be fine, other</div><div>would= just fail entirely depending on how critical the new system call was. Hope= fully,</div><div>it would have been 'fine enough' to recover, much = like using libfoo.so.10 when</div><div>libfoo.so.11 comes out.</div><div><b= r></div><div>Warner=C2=A0</div></div></div> --000000000000ed5f07064fd30c6d--