From nobody Mon Jul 20 20:20:16 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 4h3sMP2drfz6QV0h for ; Mon, 20 Jul 2026 20:20:17 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h3sMN6Tcqz40Vh for ; Mon, 20 Jul 2026 20:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784578816; 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=YQjUTEdDSQYh5p/6bPt+NT6zq94wTxqd262WBh4bqkg=; b=vycR6akhAW/ApewwN6avIdL1JSW/X87wsLZ7CN4mLiy2b4pihhN2oa8LqOxZMk942vzRPx wN9tHQdhvwScT00SjX1ds5p85h89g7gAr4Tyzg6Tk02jo+Re2GGhxI7a6Gmo89n4v5ozen 6ILgnU/YmSP9XY+XsH2qYU5FHbdGKvf+yRDvsM+7W+xaAhH1p6Odmngmy3n7g4BYVBGGSj Q35ZTlec9aEkLiHv/K98KrNtfvVjjzJx1/FBadRzlelDsNa3LGJTfCCrzdJdASMiDD5snb HXEPXG0igdTbLocp6BoXCCTBn8i4mZQtj4xq28i1qaHs653ccs5k6bb19sc9ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784578816; a=rsa-sha256; cv=none; b=qcQqT5+vkyRBlyYk4Dy9bqBHjRS4cfqoPVkGhK2NGKmuJGE0Nek0xkffvbt8CAND0qO6h3 tqVvi0NqrKoXA8JMEFKjrN1lmJW/jVw38v9xhG551r0XB3TzMo89NOMwGwyhyspCvTAjZ+ PENUeTo9u2K/ofJM6MMzYt/RmkGSHOcdHcZmWMhTLwwlx3b23rPSn7E77ZeQbu/ohNTopY fxnJKySYg324rSl04EGOEFMLaED4hna205dKKf5PlpJHVVUgNQGqTTrPwLb9u9vGle24CN u2OXkvypaVwLjQFvYkOwUhqj/OEusoewGWvPhvuTDD96EokbBnjHG33bSsuunA== 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=1784578816; 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=YQjUTEdDSQYh5p/6bPt+NT6zq94wTxqd262WBh4bqkg=; b=lfknqOv3SuoQCyOVv4MLoZS1hCovMdanpI4K1/pJykKkMcDjLN+5vlqv3/Vp6ZUQPrtZOD eIj8vY+h8jENAMuxlQQnCxtQM1OmLUjbn1Haor45uyA9ywvOzVVtv0uNR0yQNUYZD8PYfk I2Sxnt7aJb6CdgYQQnE1qYiSbtBdLKUaKwo8ZK9Bj/50xVeYYpeAy7e6UhP9NGikLS3yWZ wBQjhLi6uPhJG5RyaubtI4yUNBK07/8JSK/kSFJFFU4RW7Sn7BTQFWDu84A6dm/8yAAA5c m1qVu59VbgB1JZXDWe4yyA3sFOhkM1SOGzmG+NNQn635GTRf8GYeRmqvj6Wy+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h3sMN5YXnz2KF for ; Mon, 20 Jul 2026 20:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19202 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 20 Jul 2026 20:20:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6dbeaf1afaba - main - ptrace.2: document PT_GET_CHILDREN 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 List-Id: 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dbeaf1afaba52ba224f24773cbaac6317e11ff2 Auto-Submitted: auto-generated Date: Mon, 20 Jul 2026 20:20:16 +0000 Message-Id: <6a5e8300.19202.77ca66cb@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6dbeaf1afaba52ba224f24773cbaac6317e11ff2 commit 6dbeaf1afaba52ba224f24773cbaac6317e11ff2 Author: Konstantin Belousov AuthorDate: 2026-07-17 20:12:13 +0000 Commit: Konstantin Belousov CommitDate: 2026-07-20 20:19:12 +0000 ptrace.2: document PT_GET_CHILDREN Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58315 --- lib/libsys/ptrace.2 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/lib/libsys/ptrace.2 b/lib/libsys/ptrace.2 index e1739a56e115..cedcf92cbef1 100644 --- a/lib/libsys/ptrace.2 +++ b/lib/libsys/ptrace.2 @@ -1044,6 +1044,61 @@ Result of the execution is returned in the member. Note that the request and its result do not affect the returned value from the currently executed syscall, if any. +.It Dv PT_GET_CHILDREN +Returns a report describing the children of the process specified by +.Fa pid . +Only children visible to the current thread are reported. +.Pp +If the +.Fa addr +argument is +.Dv NULL , +the instantaneous number of children is returned as +the result of the request. +.Pp +If the +.Fa addr +argument is not +.Dv NULL , +it must point to the array of +.Bd -literal +struct ptrace_child { + pid_t pid; + int flags; +}; +.Ed +elements. +The size of the array in bytes must be passed in +.Fa data . +The +.Dv PT_GET_CHILDREN +implementation fills the array and returns the number of elements filled. +.Pp +For each element, the +.Va pid +member contains the PID of the corresponding child. +The +.Va flags +member may have the following flags set: +.Bl -tag -width PTCHLD_TRACED_BY_ME +.It Dv PTCHLD_TRACED +The child specified by the +.Va pid +member is traced. +.It Dv PTCHLD_TRACED_BY_ME +The child specified by the +.Va pid +member is traced +by the caller (not the +process specified by the +.Fa pid +argument to the function). +.It Dv PTCHLD_EXITED +The child process is exiting or is a zombie. +.It Dv PTCHLD_ORPHAN +The child process is currently being debugged by a process other +than its parent process. +.El .El .Sh PT_COREDUMP and PT_SC_REMOTE usage The process must be stopped before dumping or initiating a remote system call.