Re: git: 3b2f0bfc3516 - main - Add POSIX psiginfo(3) call
- In reply to: Warner Losh : "Re: git: 3b2f0bfc3516 - main - Add POSIX psiginfo(3) call"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 17 Apr 2025 19:24:25 UTC
On Thu, Apr 17, 2025, 9:27 AM Warner Losh <imp@bsdimp.com> wrote:
> On Thu, Apr 17, 2025 at 9:20 AM Konstantin Belousov <kib@freebsd.org>
> wrote:
> >
> > The branch main has been updated by kib:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=3b2f0bfc35167724a41c969c1823be6b1ede15ab
> >
> > 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 >= 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+=posix_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+=psignal.3 strsignal.3 \
> > +MLINKS+=psignal.3 psiginfo.3 \
> > + psignal.3 strsignal.3 \
> > psignal.3 sys_siglist.3 \
> > psignal.3 sys_signame.3
> > MLINKS+=pwcache.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 POSSIBILITY
> 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);
> > +}
>