From nobody Sun Feb 1 21:41:01 2026 X-Original-To: dev-commits-src-branches@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 4f438Z1b0yz6Qjhl 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 4f438Y6nJPz3G1c 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=1769982062; 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=Yc4jx31O/fJsVMmWycMqMXZQnAtGj+/msB+RmsQ9lW3apgZmx8qypCQ8JUdoBe24YQHpN0 3qG1SCJaJvvjolQkO7ac8dxGdIXxOezwDGZukVB6yD9y7FQybqJfzCRZkBPaA73Qz0RBAz 0B9oMo/Uen1t3PySC7KZyGiZRuZgZSAucYv5jI5am8/xr0Foz0P79jdsJUufqB2VcyTvff oiOn/W/mR/B8cAgOTRoKk06xLiYXdXfEQAt7h85f8Kwk5EyXx8qhsfMVAPqrgHLdX8lYK7 AIo3exiCmDlsJkTyrzW3AcMKWHk9DWTmYMDfbo5Y0cor2BwoS7xEcZAJE+ukNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769982062; a=rsa-sha256; cv=none; b=il6fSXEG/yaC5Fp+rBYOaOF/f1NgSUbzvRUC4wWtHAUs7YC3ERxvfjc4H8msE0UlvIpAtK Djfiwpbj7TS2bijEmH8fSeZV7hhnJIuzqE1JuVpQ7LXVLCT0XitTXN9pMu6Ss3UikadrUj UHuQIfRyup10c5Iz4WmFshjHFDJn4ehrqj8emqXqsdWFw2+bXSz2s3c302g4OX8DeDgF0x n5tnQhkb7R4fznHxNPbVMc/Fx2xh6PEmAn24XXDrCj9fKgiZI/E27TeaZJcJWjq8jwvkH6 n9+nycklHLtQixY8NkmPSfABChKjL9dd62Dc25JJAZdvGfyp0fy1+7DOG8SNpA== 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=1769982062; 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=QsaSICQ47OzxC2KEAiYrCcKcstXgn743TXOd6V8x5J07r90pjA4JUeQZYdOTa/xcLfz//d gyLL8/Vz87d7CxCQ0hDvWqRKaiNWc/8H5dvNNRGIDShQkN9GjvzdnfmA7ZtveYBLOyJqSk zMay54BcB/3VL6CEPXYxJpIoMA5Xfm0qXm51HAaZ3CxZFyCo+ejJz27Q8RPEZc3C+HLrrA WsBTqI+ks3uk1g+dVtxLEgrIDy13ofPYYRT1xv4kcwZiEAQqsUvHx7rWx2vquHc0mZYCzj F8z1/CydS+luUU3FFTHINLD4IrR96jGP7kwuPOqx4aEYvibsvoQSaORHbbt2tA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f438Y6FmXzxct 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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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 */