From nobody Thu Nov 12 11:01:55 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 4jQHX358rPz70R7Y for ; Thu, 12 Nov 2026 11:01:55 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jQHX317Pzz4MY2 for ; Thu, 12 Nov 2026 11:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794481315; 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=DeU/lLF0edqQUQPA0F5k88eXuw6c6bgicfAZKwEhCfM=; b=ooQm+HB0QDcqhBQw8KnhLI+0R5+qZ0rHMu/Y8tSggoM0h7LjsdPoIQPLqJgoDlP9gVMnuy Qbw7X05zFOVbyw4+kw1AIMBBkKS5q2By9a0mykSgO6yiQkMiX3z/PKk7ca37i1vEoDf6LR KdwNG7aoZEmf2wVYV5ZiFjl55wIpCQwgRPwaQuGBsjseLuAfg1bqvK+iDD9siDc4eu2Hu7 z3BozyeGNe17DapGoDF6GE4vwXQXE8p7Yx5Ipu91q++3YkJH8lyH2wozUQGvSnsVo3Zf9S ccA8wr0NgZ7MrDThJtHBRiXGeUwClgKJYZMdBwLwmb1prLBRNzaUTN1wHIWmhQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794481315; b=IOOpRqKY+r+zS2oEnRPFM2dvVFAyU4y5Clseff98UFGcl7rzBbTVUlXfRDKJNomH1OLygv TpfK6kglCT73alwv7yOC3l5DdGYBPLKDntXmIFrjmV8HimM1P679t7Te1CdTaRRulevsxI kdNppvWL1/UVcwFnuLu6bssXNjXMYXmR/Q2GhOerYAHnZnYX9NveKUVOENqqjLOPUeWfOj SFRUXS3RLyiIkAk2+Gwrl5FRbjXmKAxekhzAaHGCr+jIoSaIl9ZK1zpHiSWm1l/rrC4ZQt mxhrDYBSA6VBmtZAd8Akq7bkPQP9jnzXM7Xh2ygZz+hnlymcMUorvFXDmkMYdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794481315; 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=DeU/lLF0edqQUQPA0F5k88eXuw6c6bgicfAZKwEhCfM=; b=lKg2XafE6tAOkDmn3Zk4nhzS52oKqT8ZWlwmqqX/7V7YZsELFAXrOGJFBXh7ff//NrLosE GEQ8l+ezLzMLCmTCwydmtRAJQalSp1a6G4ASAhQgR9dLu42J8CG+mk4enILNOBc500gzu+ aL7ZK3V2A7uLJ0yyfgKrHaTS1E+xwElvnkpQvisu3dVRCWb0ancBpb6j1MRMBlDPAN2pZi nqjdMjxwco7XUekHjbi23pRsBguSl9b4lwBKum3ZSUwNiunX77OwbcWOQ+gLbCPgGAawGg RmVTuZcBzJce4kXbedHE+UCNsOl5aGOGYKWpty2Ka5HnSou1+cM60KQWjl/N0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jQHX30XQxz10d2 for ; Thu, 12 Nov 2026 11:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1eb7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 12 Nov 2026 11:01:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 30d759067be9 - main - pdwait(2): add user_pdwait List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30d759067be91e3f74b98f537512eb5030c89e57 Auto-Submitted: auto-generated Date: Thu, 12 Nov 2026 11:01:55 +0000 Message-Id: <6af59ca3.1eb7.8d7eb7f@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=30d759067be91e3f74b98f537512eb5030c89e57 commit 30d759067be91e3f74b98f537512eb5030c89e57 Author: Brooks Davis AuthorDate: 2026-11-12 11:01:30 +0000 Commit: Brooks Davis CommitDate: 2026-11-12 11:01:30 +0000 pdwait(2): add user_pdwait Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284 --- sys/kern/kern_exit.c | 32 +++++++++++++++++++++----------- sys/sys/syscallsubr.h | 2 ++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index f4d7d50c7d23..939b5fe51638 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -968,11 +968,8 @@ user_wait6(struct thread *td, idtype_t idtype, id_t id, int *statusp, int sys_pdwait(struct thread *td, struct pdwait_args *uap) { - struct __wrusage wru, *wrup; siginfo_t si, *sip; - int error, status; - - wrup = uap->wrusage != NULL ? &wru : NULL; + int error; if (uap->info != NULL) { sip = &si; @@ -980,18 +977,31 @@ sys_pdwait(struct thread *td, struct pdwait_args *uap) } else { sip = NULL; } - - error = kern_pdwait(td, uap->fd, &status, uap->options, wrup, sip); - - if (uap->status != NULL && error == 0) - error = copyout(&status, uap->status, sizeof(status)); - if (uap->wrusage != NULL && error == 0) - error = copyout(&wru, uap->wrusage, sizeof(wru)); + error = user_pdwait(td, uap->fd, uap->status, uap->options, + uap->wrusage, sip); if (uap->info != NULL && error == 0) error = copyout(&si, uap->info, sizeof(si)); return (error); } +int +user_pdwait(struct thread *td, int fd, int *statusp, int options, + struct __wrusage *wrusage, siginfo_t *sip) +{ + struct __wrusage wru, *wrup; + int error, status; + + wrup = wrusage != NULL ? &wru : NULL; + + error = kern_pdwait(td, fd, &status, options, wrup, sip); + + if (statusp != NULL && error == 0) + error = copyout(&status, statusp, sizeof(status)); + if (wrusage != NULL && error == 0) + error = copyout(&wru, wrusage, sizeof(wru)); + return (error); +} + /* * Reap the remains of a zombie process and optionally return status and * rusage. Asserts and will release both the proctree_lock and the process diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 1cda115cf738..f098ee5ed750 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -659,6 +659,8 @@ int user_jail_set(struct thread *td, struct iovec *iovp, unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f); int user_kldload(struct thread *td, const char *file); int user_pdgetpid(struct thread *td, int fd, pid_t *pidp); +int user_pdwait(struct thread *td, int fd, int *statusp, int options, + struct __wrusage *wrusage, siginfo_t *sip); int user_poll(struct thread *td, struct pollfd *fds, u_int nfds, int timeout); int user_ppoll(struct thread *td, struct pollfd *fds, u_int nfds,