From nobody Thu Apr 17 15:27:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zdhbb4cZSz5tJkL for ; Thu, 17 Apr 2025 15:27:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zdhbb2hZSz40DF for ; Thu, 17 Apr 2025 15:27:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-301918a4e3bso931944a91.3 for ; Thu, 17 Apr 2025 08:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1744903657; x=1745508457; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TRDm9BVWr8V/9AW9prak5vPVkCxLZANNq2wli1X0sdw=; b=lzzpFofDxh9bfcekYmDSB+jImif/g+tys/oC825dtvrGL6oocmJJPLtjd4Jg1SrH4r 6Zb/M8xjn0oQFTFMvoRc3AZkD0/g08OWzuDfEWfNFAJH/uQ9/Y23tT+aC1X2gX+DgDle j0ZPZnSxyyIHMzoRzjdy+yBJl4JO64PcJ2oTL/1d9b1yEbis/Owc2gw9gcHhXXjHU6/g bnS/UyxQPXC6njXB8WLcjCP1H75n9sL2YKqTh/X1j/byniClJi9SnA4yMIY6MT8x4h/W 6ae5YW88KxP6FDKcUbxUCKRolu0FNpNFIEZJHjd63/J6vJxeNP46IyErhTxDvQYOhhl0 GKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744903657; x=1745508457; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TRDm9BVWr8V/9AW9prak5vPVkCxLZANNq2wli1X0sdw=; b=FQ8Y4qe3owdmz2N0JFUDYaMYe1Mh5K1wbQoNs1aCW9TEcGJ1oxf6VAJtwZ9cRyc3rb nxQA5+2NzoO+f0/ilAbQnImx+nBM+I0Y3NMkEUzf1EoEhhMfCpI0JHqJ/ILR2GTAzzXr i7S1UttB1gAEd2c/mZ9fEkdhzvHE0azc+VVUfduKjzVtUXvH1537ksmJIHTiHIZ/rKbR Gt0H9KG6MEdieElkJfW8vs8u6HYvqslvFagm7fTgpomuiKCEMiaW7d5ibmpgRRrEYJcf 254FNq+T/9fDVeOOQAF94bjsdJ4Z8viRd3BpKfSOmNQ+XjAjxndLCZvnAN0xD742aJIJ vDhw== X-Forwarded-Encrypted: i=1; AJvYcCW2gQ9Gn1qApKMTmqM7U1ML57DIvdkpxeFm/fTrVuAlEWisqK2gEvO8abb4kSqfHfuMHlNZ8vka5l0yJjcS7R1MMTO2VQ==@freebsd.org X-Gm-Message-State: AOJu0Yx3wf9hM0Vbr+lEqkKYLFPpi3uHUtvHvC1f+/TWo+eqm4PEwgYi lo/PQ2aOk2BF8Luw9n0IiqK1Y2dqfl21GiYJWnOHgZ7jr8cXjzla/uZgm0qn8wQsOpNVbw/39iF pmnrByZA9yW4tU5exaWZGKIi2a37n0EFPqajbgQ== X-Gm-Gg: ASbGncu341QXBocPxwZGgIKN6JaAFlguWgdpvqLiwqB041mU2hUcdr2FU0GflzzpmxJ p8YJnkDiHWUbntsK4ZOB+yFAeZcin6O7MYBkcbqFFDd1HJ18Q94JyvrQ+kg15Zu3b4mRTYmIvC/ u/xYrBhTbzO3PwLWjeQu0r4fYwEjPtU1T7PvbXHzwHwuel/oKE4vI= X-Google-Smtp-Source: AGHT+IGw5VlWSbtW/ROpZSeOoFR5FnQXE+1ecJ+dMCFnh7qlYONYldlb1sukyN3kX4skLJWMPwhKC/D75PMxDuSCa+w= X-Received: by 2002:a17:90b:574c:b0:2ee:edae:75e with SMTP id 98e67ed59e1d1-30863f1c831mr8921011a91.13.1744903657525; Thu, 17 Apr 2025 08:27:37 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202504171520.53HFK0o7057403@gitrepo.freebsd.org> In-Reply-To: <202504171520.53HFK0o7057403@gitrepo.freebsd.org> From: Warner Losh Date: Thu, 17 Apr 2025 09:27:26 -0600 X-Gm-Features: ATxdqUH-DY75TpsFNqO6tkf-gmu7msKFmVm1K7P39-tUFJbLeg8a_Eb-tcpb_nU Message-ID: Subject: Re: git: 3b2f0bfc3516 - main - Add POSIX psiginfo(3) call To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Zdhbb2hZSz40DF X-Spamd-Bar: ---- On Thu, Apr 17, 2025 at 9:20=E2=80=AFAM Konstantin Belousov wrote: > > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D3b2f0bfc35167724a41c969c18= 23be6b1ede15ab > > commit 3b2f0bfc35167724a41c969c1823be6b1ede15ab > Author: Ricardo Branco > AuthorDate: 2025-04-16 07:52:13 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-04-17 15:19:44 +0000 > > Add POSIX psiginfo(3) call > > Signed-off-by: Ricardo Branco > 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. 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 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); > +}