Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2025 13:24:25 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>,  "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 3b2f0bfc3516 - main - Add POSIX psiginfo(3) call
Message-ID:  <CANCZdfp0k03Q=5Jvv_8mQQeYzSJ7_6zgXEbYtrZd6Ap=A%2Bc46g@mail.gmail.com>
In-Reply-To: <CANCZdfodA022MidoB%2BCsKngVK%2Bm2%2B0DhwL-iLH9xz73Pr8_Z5A@mail.gmail.com>
References:  <202504171520.53HFK0o7057403@gitrepo.freebsd.org> <CANCZdfodA022MidoB%2BCsKngVK%2Bm2%2B0DhwL-iLH9xz73Pr8_Z5A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000004002ed0632fe5a92
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 17, 2025, 9:27=E2=80=AFAM Warner Losh <imp@bsdimp.com> wrote:

> On Thu, Apr 17, 2025 at 9:20=E2=80=AFAM Konstantin Belousov <kib@freebsd.=
org>
> wrote:
> >
> > The branch main has been updated by kib:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=3D3b2f0bfc35167724a41c969c1823be6=
b1ede15ab
> >
> > commit 3b2f0bfc35167724a41c969c1823be6b1ede15ab
> > Author:     Ricardo Branco <rbranco@suse.de>
> > AuthorDate: 2025-04-16 07:52:13 +0000
> > Commit:     Konstantin Belousov <kib@FreeBSD.org>
> > CommitDate: 2025-04-17 15:19:44 +0000
> >
> >     Add POSIX psiginfo(3) call
> >
> >     Signed-off-by: Ricardo Branco <rbranco@suse.de>
> >     PR:     286133
> >     MFC after:       1 week
> >     Github PR:       https://github.com/freebsd/freebsd-src/pull/1666
>
> We've been using 'Pull Request: ' for this trailer.
>

And the reason we do Pull-request: or Pull Request: is that both autoclose
the pull request... We're working on moving to the git standard with dashes
since it simplifies tool and can have better uniformity enforcement...

Warner

Warner
>
> > ---
> >  include/signal.h          |  1 +
> >  lib/libc/gen/Makefile.inc |  3 ++-
> >  lib/libc/gen/Symbol.map   |  1 +
> >  lib/libc/gen/psignal.3    | 22 +++++++++++++++++++++-
> >  lib/libc/gen/psignal.c    |  6 ++++++
> >  5 files changed, 31 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/signal.h b/include/signal.h
> > index 388e164d7943..c1d341f317f4 100644
> > --- a/include/signal.h
> > +++ b/include/signal.h
> > @@ -115,6 +115,7 @@ int siginterrupt(int, int);
> >  #endif
> >
> >  #if __POSIX_VISIBLE >=3D 200809
> > +void   psiginfo(const siginfo_t *, const char *);
> >  void   psignal(int, const char *);
> >  #endif
> >
> > diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
> > index 9b92e52cdfad..a8308a057b05 100644
> > --- a/lib/libc/gen/Makefile.inc
> > +++ b/lib/libc/gen/Makefile.inc
> > @@ -465,7 +465,8 @@ MLINKS+=3Dposix_spawn.3 posix_spawnp.3 \
> >         posix_spawnattr_getsigdefault.3 posix_spawnattr_setsigdefault.3=
 \
> >         posix_spawnattr_getsigmask.3 posix_spawnattr_setsigmask.3 \
> >         posix_spawnattr_init.3 posix_spawnattr_destroy.3
> > -MLINKS+=3Dpsignal.3 strsignal.3 \
> > +MLINKS+=3Dpsignal.3 psiginfo.3 \
> > +       psignal.3 strsignal.3 \
> >         psignal.3 sys_siglist.3 \
> >         psignal.3 sys_signame.3
> >  MLINKS+=3Dpwcache.3 gid_from_group.3 \
> > diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
> > index ca3974e6b747..21b66acba213 100644
> > --- a/lib/libc/gen/Symbol.map
> > +++ b/lib/libc/gen/Symbol.map
> > @@ -458,6 +458,7 @@ FBSD_1.8 {
> >         aio_read2;
> >         aio_write2;
> >         execvpe;
> > +       psiginfo;
> >         rtld_get_var;
> >         rtld_set_var;
> >  };
> > diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3
> > index cd3cef0b44a9..605c3cf2d8fe 100644
> > --- a/lib/libc/gen/psignal.3
> > +++ b/lib/libc/gen/psignal.3
> > @@ -25,11 +25,12 @@
> >  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILIT=
Y
> OF
> >  .\" SUCH DAMAGE.
> >  .\"
> > -.Dd May 30, 2016
> > +.Dd Apr 16, 2025
> >  .Dt PSIGNAL 3
> >  .Os
> >  .Sh NAME
> >  .Nm psignal ,
> > +.Nm psiginfo ,
> >  .Nm strsignal ,
> >  .Nm sys_siglist ,
> >  .Nm sys_signame
> > @@ -40,6 +41,8 @@
> >  .In signal.h
> >  .Ft void
> >  .Fn psignal "int sig" "const char *s"
> > +.Ft void
> > +.Fn psiginfo "const siginfo_t *si" "const char *s"
> >  .Vt extern const char * const sys_siglist[] ;
> >  .Vt extern const char * const sys_signame[] ;
> >  .In string.h
> > @@ -79,6 +82,16 @@ the string
> >  .Dq "Unknown signal"
> >  is produced.
> >  .Pp
> > +The
> > +.Fn psiginfo
> > +function is similar to
> > +.Fn psignal ,
> > +except that the signal number information is taken from the
> > +.Fa si
> > +argument which is a
> > +.Vt siginfo_t
> > +structure.
> > +.Pp
> >  The message strings can be accessed directly
> >  through the external array
> >  .Va sys_siglist ,
> > @@ -104,3 +117,10 @@ The
> >  .Fn psignal
> >  function appeared in
> >  .Bx 4.2 .
> > +The
> > +.Fn psiginfo
> > +function appeared in
> > +.Fx 15.0 ,
> > +.Nx 6.0 ,
> > +and
> > +.Dx 4.1 .
> > diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c
> > index ab044f683d86..291a6a9337a0 100644
> > --- a/lib/libc/gen/psignal.c
> > +++ b/lib/libc/gen/psignal.c
> > @@ -55,3 +55,9 @@ psignal(int sig, const char *s)
> >         (void)_write(STDERR_FILENO, c, strlen(c));
> >         (void)_write(STDERR_FILENO, "\n", 1);
> >  }
> > +
> > +void
> > +psiginfo(const siginfo_t *si, const char *s)
> > +{
> > +       psignal(si->si_signo, s);
> > +}
>

--0000000000004002ed0632fe5a92
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote gmail_quote_contai=
ner"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Apr 17, 2025, 9:27=E2=80=
=AFAM Warner Losh &lt;<a href=3D"mailto:imp@bsdimp.com">imp@bsdimp.com</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 17, 2025 at =
9:20=E2=80=AFAM Konstantin Belousov &lt;<a href=3D"mailto:kib@freebsd.org" =
target=3D"_blank" rel=3D"noreferrer">kib@freebsd.org</a>&gt; wrote:<br>
&gt;<br>
&gt; The branch main has been updated by kib:<br>
&gt;<br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D3b2f0bfc3516=
7724a41c969c1823be6b1ede15ab" rel=3D"noreferrer noreferrer" target=3D"_blan=
k">https://cgit.FreeBSD.org/src/commit/?id=3D3b2f0bfc35167724a41c969c1823be=
6b1ede15ab</a><br>
&gt;<br>
&gt; commit 3b2f0bfc35167724a41c969c1823be6b1ede15ab<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Ricardo Branco &lt;<a href=3D"mailto:rbranc=
o@suse.de" target=3D"_blank" rel=3D"noreferrer">rbranco@suse.de</a>&gt;<br>
&gt; AuthorDate: 2025-04-16 07:52:13 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Konstantin Belousov &lt;kib@FreeBSD.org&gt;=
<br>
&gt; CommitDate: 2025-04-17 15:19:44 +0000<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0Add POSIX psiginfo(3) call<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0Signed-off-by: Ricardo Branco &lt;<a href=3D"mailto=
:rbranco@suse.de" target=3D"_blank" rel=3D"noreferrer">rbranco@suse.de</a>&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0286133<br>
&gt;=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 =C2=A01 week<br>
&gt;=C2=A0 =C2=A0 =C2=A0Github PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"htt=
ps://github.com/freebsd/freebsd-src/pull/1666" rel=3D"noreferrer noreferrer=
" target=3D"_blank">https://github.com/freebsd/freebsd-src/pull/1666</a><br=
>
<br>
We&#39;ve been using &#39;Pull Request: &#39; for this trailer.<br></blockq=
uote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">And the reas=
on we do Pull-request: or Pull Request: is that both autoclose the pull req=
uest... We&#39;re working on moving to the git standard with dashes since i=
t simplifies tool and can have better uniformity enforcement...</div><div d=
ir=3D"auto"><br></div><div dir=3D"auto">Warner</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto"><div class=3D"gmail_quote gmail_quote_container"><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex">
Warner<br>
<br>
&gt; ---<br>
&gt;=C2=A0 include/signal.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 1 +<b=
r>
&gt;=C2=A0 lib/libc/gen/Makefile.inc |=C2=A0 3 ++-<br>
&gt;=C2=A0 lib/libc/gen/Symbol.map=C2=A0 =C2=A0|=C2=A0 1 +<br>
&gt;=C2=A0 lib/libc/gen/psignal.3=C2=A0 =C2=A0 | 22 +++++++++++++++++++++-<=
br>
&gt;=C2=A0 lib/libc/gen/psignal.c=C2=A0 =C2=A0 |=C2=A0 6 ++++++<br>
&gt;=C2=A0 5 files changed, 31 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/include/signal.h b/include/signal.h<br>
&gt; index 388e164d7943..c1d341f317f4 100644<br>
&gt; --- a/include/signal.h<br>
&gt; +++ b/include/signal.h<br>
&gt; @@ -115,6 +115,7 @@ int siginterrupt(int, int);<br>
&gt;=C2=A0 #endif<br>
&gt;<br>
&gt;=C2=A0 #if __POSIX_VISIBLE &gt;=3D 200809<br>
&gt; +void=C2=A0 =C2=A0psiginfo(const siginfo_t *, const char *);<br>
&gt;=C2=A0 void=C2=A0 =C2=A0psignal(int, const char *);<br>
&gt;=C2=A0 #endif<br>
&gt;<br>
&gt; diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc<br>
&gt; index 9b92e52cdfad..a8308a057b05 100644<br>
&gt; --- a/lib/libc/gen/Makefile.inc<br>
&gt; +++ b/lib/libc/gen/Makefile.inc<br>
&gt; @@ -465,7 +465,8 @@ MLINKS+=3Dposix_spawn.3 posix_spawnp.3 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0posix_spawnattr_getsigdefault.3 posix=
_spawnattr_setsigdefault.3 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0posix_spawnattr_getsigmask.3 posix_sp=
awnattr_setsigmask.3 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0posix_spawnattr_init.3 posix_spawnatt=
r_destroy.3<br>
&gt; -MLINKS+=3Dpsignal.3 strsignal.3 \<br>
&gt; +MLINKS+=3Dpsignal.3 psiginfo.3 \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0psignal.3 strsignal.3 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0psignal.3 sys_siglist.3 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0psignal.3 sys_signame.3<br>
&gt;=C2=A0 MLINKS+=3Dpwcache.3 gid_from_group.3 \<br>
&gt; diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map<br>
&gt; index ca3974e6b747..21b66acba213 100644<br>
&gt; --- a/lib/libc/gen/Symbol.map<br>
&gt; +++ b/lib/libc/gen/Symbol.map<br>
&gt; @@ -458,6 +458,7 @@ FBSD_1.8 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0aio_read2;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0aio_write2;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0execvpe;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0psiginfo;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rtld_get_var;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rtld_set_var;<br>
&gt;=C2=A0 };<br>
&gt; diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3<br>
&gt; index cd3cef0b44a9..605c3cf2d8fe 100644<br>
&gt; --- a/lib/libc/gen/psignal.3<br>
&gt; +++ b/lib/libc/gen/psignal.3<br>
&gt; @@ -25,11 +25,12 @@<br>
&gt;=C2=A0 .\&quot; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE=
 POSSIBILITY OF<br>
&gt;=C2=A0 .\&quot; SUCH DAMAGE.<br>
&gt;=C2=A0 .\&quot;<br>
&gt; -.Dd May 30, 2016<br>
&gt; +.Dd Apr 16, 2025<br>
&gt;=C2=A0 .Dt PSIGNAL 3<br>
&gt;=C2=A0 .Os<br>
&gt;=C2=A0 .Sh NAME<br>
&gt;=C2=A0 .Nm psignal ,<br>
&gt; +.Nm psiginfo ,<br>
&gt;=C2=A0 .Nm strsignal ,<br>
&gt;=C2=A0 .Nm sys_siglist ,<br>
&gt;=C2=A0 .Nm sys_signame<br>
&gt; @@ -40,6 +41,8 @@<br>
&gt;=C2=A0 .In signal.h<br>
&gt;=C2=A0 .Ft void<br>
&gt;=C2=A0 .Fn psignal &quot;int sig&quot; &quot;const char *s&quot;<br>
&gt; +.Ft void<br>
&gt; +.Fn psiginfo &quot;const siginfo_t *si&quot; &quot;const char *s&quot=
;<br>
&gt;=C2=A0 .Vt extern const char * const sys_siglist[] ;<br>
&gt;=C2=A0 .Vt extern const char * const sys_signame[] ;<br>
&gt;=C2=A0 .In string.h<br>
&gt; @@ -79,6 +82,16 @@ the string<br>
&gt;=C2=A0 .Dq &quot;Unknown signal&quot;<br>
&gt;=C2=A0 is produced.<br>
&gt;=C2=A0 .Pp<br>
&gt; +The<br>
&gt; +.Fn psiginfo<br>
&gt; +function is similar to<br>
&gt; +.Fn psignal ,<br>
&gt; +except that the signal number information is taken from the<br>
&gt; +.Fa si<br>
&gt; +argument which is a<br>
&gt; +.Vt siginfo_t<br>
&gt; +structure.<br>
&gt; +.Pp<br>
&gt;=C2=A0 The message strings can be accessed directly<br>
&gt;=C2=A0 through the external array<br>
&gt;=C2=A0 .Va sys_siglist ,<br>
&gt; @@ -104,3 +117,10 @@ The<br>
&gt;=C2=A0 .Fn psignal<br>
&gt;=C2=A0 function appeared in<br>
&gt;=C2=A0 .Bx 4.2 .<br>
&gt; +The<br>
&gt; +.Fn psiginfo<br>
&gt; +function appeared in<br>
&gt; +.Fx 15.0 ,<br>
&gt; +.Nx 6.0 ,<br>
&gt; +and<br>
&gt; +.Dx 4.1 .<br>
&gt; diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c<br>
&gt; index ab044f683d86..291a6a9337a0 100644<br>
&gt; --- a/lib/libc/gen/psignal.c<br>
&gt; +++ b/lib/libc/gen/psignal.c<br>
&gt; @@ -55,3 +55,9 @@ psignal(int sig, const char *s)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(void)_write(STDERR_FILENO, c, strlen=
(c));<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(void)_write(STDERR_FILENO, &quot;\n&=
quot;, 1);<br>
&gt;=C2=A0 }<br>
&gt; +<br>
&gt; +void<br>
&gt; +psiginfo(const siginfo_t *si, const char *s)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0psignal(si-&gt;si_signo, s);<br>
&gt; +}<br>
</blockquote></div></div></div>

--0000000000004002ed0632fe5a92--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp0k03Q=5Jvv_8mQQeYzSJ7_6zgXEbYtrZd6Ap=A%2Bc46g>