From nobody Thu Apr 17 15:27:26 2025 X-Original-To: dev-commits-src-all@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 4Zdhbh4sB0z5tJRv for ; Thu, 17 Apr 2025 15:27:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 4Zdhbh1j4fz40Sg 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-x1036.google.com with SMTP id 98e67ed59e1d1-2ff799d99dcso912606a91.1 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=WU0dNTDc2JR1T6u9ONLgESThebeJ42JsuNzyun3Iv3Oor0HAmgve97Ao+/RPLbWfW1 Z1n5d1N1aR1hAYn1f5C9Lz1HLXZrZEsxPz2SZ88lcXDIjpslNR5ALcon0LUryKx+gRGj fj67yKX78kl4oC7oWKZ11gijmU+n4AFJCeVNucot+p8fyTZAVjil47iPm6G5ZKqbp0g5 XI3fG2EA2OYr5za7casKJqm5b+Xk5/ku+VWCP4aHKOKGwSKwglgk4i17n1oJ61e2rk6f Q9roXjASZPEFpj6o3htzGmy5VCY3h+cNXPNe1n4rL7BZIWwAqbnLwVKZ4+EtEUPNaj/T xsFg== X-Forwarded-Encrypted: i=1; AJvYcCUgjNjJ2G2VWrDui/GWMnVzCiijE2Skf54K/tOeIDKNNkDcmpXSdHX/PKcOk+fwZ9Gv9GtqdJoi9SitxVWT4weTYrRu@freebsd.org X-Gm-Message-State: AOJu0YzwE8qzceJyzuCOVEATjNdn44pT6KTyg/QxQ7oqyXPGXURPSUwD pVojOzbFqARyI1mthC/kDxLJnDhPUQLZ4xvi7fc3qBMvVnCN8OVQmbCDE1ODLzbo0VhsLPAaTG8 Vp4shePeGybyI0t11kZJU5ejxyZRDZfn01wWQMQ== X-Gm-Gg: ASbGnctHWnkkTGpC8Mw9K4HLD4dYDo+qK60MUOnc3rDORL8qI1qPU63toWqd0lffk2+ FOz/UbDKXzu+pOhaBnYNaozeX4CU5B/5BLSn+903e990v+HWTt6MSVTCJJ8OdO6UhvPH+G4geyL ib1sIsm9gI91qd3v1quK8VrrJ4fzjMahn8QSV+upLPplu5HrTQB+I= 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 4Zdhbh1j4fz40Sg 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); > +}