From nobody Sun Feb 1 21:41:01 2026 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 4f438Z1b68z6QjJx for ; Sun, 01 Feb 2026 21:41:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f438Y6lWhz3FkM for ; Sun, 01 Feb 2026 21:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769982061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HwHYNMsxw0I6Ugiu+nTQ24dQf/15P3qByNnei72PR8g=; b=iw8vCDhxPbwyq4yK0d28Q0S53QTENISg1CJU83PaEg5HQMWBwUMKx2lVK24qI9/JDs5mpI b1cfAP70f90tbkj4Fyz8yAwf/pQ/s5uLamTrLvSEtuBBLhpCjkpO9hnovaeAU9kpO3KfJg kMkBi07K7Wji6a04sp3DaG7fPWLTJEu+oWgoFw1qRYJGszGgvP3DuuXuLZua6Z9mw1Lm4D sh2cI9q9ibsv/19fE07eOZBKFFG2Fhj+jU455+pN+LVbeyRE0OyyQlnca5vWjl3sh5RK7p PBirV9gyYUpsRNPrMoKEoNYtO6dN/N0FyC6I1AlKS59MVJA2xGDAs1mxfzwnKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769982061; a=rsa-sha256; cv=none; b=VaMUPEbgwZbfZ9qtKt7doAX47ES7b6+26Q8CAFUFB95Gc3u//FaT/OHBj8ZNLLZ6ufzqhu ysf/C9xK6QsG3tv3eC9ln5SrDtP8LClNh4pQdOrHJW9ItjqdfMZLLuSLsSa71GstyBLiiE LBOhgDEppW2EOLW9BE2YaFZb0BrJU7GswbANJDq0P+f76rXMiFUtJ1d/8v80rp+9jZPSc1 Caj99OYw6N5y/L1qtu89K6Tq41RJtni1O2U2B706nBF9cfo5di4H1ScJ9lN7EVs8qxtP5y Al3FIH56dBNCqVAfykAzHwTJ7p002CcaDxymK5tSnSUsZzo0N/E41Kc1Xd+Hnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769982061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HwHYNMsxw0I6Ugiu+nTQ24dQf/15P3qByNnei72PR8g=; b=K48AqJisLSlW3OCAEEbXdxxo/NtW1vIaZreASZLiQYe3K3n5nrwD5qAc6oE+0iNs1DZ0nB TYviBjYHOGYI9x01w7UyeHDJI1SgYVqi1xvkmeh1iKGpVupfggXXkkdAObLsVCOFesD9d7 XeJFrIRj8DYKhN/9bI6ZgNVICwo/V8Zrp4Gb32hxtHxEyyYeF0BHIiRFfZUl4XkwQRpUWo hlKgF+EvNEzvNm7fQ6kcnVrkrTCsDljp+htlW3AoTdbuUw6C7pPF3b9/SIg/99pIY5vb4X dT13vTe46i9KuYx9Nix1t6jmKSGdMKiB5y9fVuNvml2McxCT3xRUFQjQc9yjsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f438Y6FhqzxqN for ; Sun, 01 Feb 2026 21:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d21f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 01 Feb 2026 21:41:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6820fe965f1d - stable/15 - lib/libsys, lib/libc: export pdwait 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6820fe965f1d9e834bd5e1dbb31d61b4d51ae368 Auto-Submitted: auto-generated Date: Sun, 01 Feb 2026 21:41:01 +0000 Message-Id: <697fc86d.3d21f.14d78903@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6820fe965f1d9e834bd5e1dbb31d61b4d51ae368 commit 6820fe965f1d9e834bd5e1dbb31d61b4d51ae368 Author: Konstantin Belousov AuthorDate: 2026-01-08 03:49:33 +0000 Commit: Konstantin Belousov CommitDate: 2026-02-01 21:38:49 +0000 lib/libsys, lib/libc: export pdwait (cherry picked from commit 2d555ec85a716e016be587b2a1606ca69267f870) --- lib/libc/include/libc_private.h | 1 + lib/libc/sys/Symbol.map | 4 ++++ lib/libc/sys/pdwait.c | 20 ++++++++++++++++++++ lib/libsys/Makefile.sys | 1 + lib/libsys/interposing_table.c | 1 + lib/libthr/thread/thr_syscalls.c | 15 +++++++++++++++ sys/sys/procdesc.h | 4 ++++ 7 files changed, 46 insertions(+) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index db4cbc32be35..299629fce2ad 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -252,6 +252,7 @@ enum { INTERPOS__reserved0, /* was distribute_static_tls */ INTERPOS_pdfork, INTERPOS_uexterr_gettext, + INTERPOS_pdwait, INTERPOS_MAX }; diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 32b1b0ecee05..8acffcfd714e 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -71,3 +71,7 @@ FBSD_1.6 { FBSD_1.7 { _Fork; }; + +FBSD_1.9 { + pdwait; +}; diff --git a/lib/libc/sys/pdwait.c b/lib/libc/sys/pdwait.c new file mode 100644 index 000000000000..89d43b7fca2e --- /dev/null +++ b/lib/libc/sys/pdwait.c @@ -0,0 +1,20 @@ +/* + * Copyright 2026 The FreeBSD Foundation. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + */ + +#include +#include +#include "libc_private.h" + +#pragma weak pdwait +int +pdwait(int fd, int *status, int options, struct __wrusage *ru, + struct __siginfo *infop) +{ + return (INTERPOS_SYS(pdwait, fd, status, options, ru, infop)); +} diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index bd65b58083c2..f2c5ba9593cb 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -73,6 +73,7 @@ INTERPOSED = \ open \ openat \ pdfork \ + pdwait \ poll \ ppoll \ pselect \ diff --git a/lib/libsys/interposing_table.c b/lib/libsys/interposing_table.c index 31cdb1511ab8..0151364f89d2 100644 --- a/lib/libsys/interposing_table.c +++ b/lib/libsys/interposing_table.c @@ -72,6 +72,7 @@ static interpos_func_t __libsys_interposing[INTERPOS_MAX] = { SLOT(fdatasync, __sys_fdatasync), SLOT(clock_nanosleep, __sys_clock_nanosleep), SLOT(pdfork, __sys_pdfork), + SLOT(pdwait, __sys_pdwait), }; #undef SLOT diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c index 188374a30070..bff2d0624aee 100644 --- a/lib/libthr/thread/thr_syscalls.c +++ b/lib/libthr/thread/thr_syscalls.c @@ -584,6 +584,20 @@ __thr_wait6(idtype_t idtype, id_t id, int *status, int options, return (ret); } +static pid_t +__thr_pdwait(int fd, int *status, int options, struct __wrusage *ru, + siginfo_t *infop) +{ + struct pthread *curthread; + pid_t ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_pdwait(fd, status, options, ru, infop); + _thr_cancel_leave(curthread, ret == -1); + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled at start, but if the thread wrote some data, @@ -685,6 +699,7 @@ __thr_interpose_libc(void) SLOT(clock_nanosleep); SLOT(pdfork); SLOT(uexterr_gettext); + SLOT(pdwait); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h index 6ce6c9f81de1..6a9168b04a68 100644 --- a/sys/sys/procdesc.h +++ b/sys/sys/procdesc.h @@ -122,10 +122,14 @@ struct rusage; * Process descriptor system calls. */ __BEGIN_DECLS +struct __wrusage; +struct __siginfo; + pid_t pdfork(int *, int); pid_t pdrfork(int *, int, int); int pdkill(int, int); int pdgetpid(int, pid_t *); +int pdwait(int, int *, int, struct __wrusage *, struct __siginfo *); __END_DECLS #endif /* _KERNEL */