From nobody Mon Jul 20 20:20:16 2026 X-Original-To: dev-commits-src-main@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 4h3sMP2hMVz6QTx6 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 4h3sMP0mQRz40m9 for ; Mon, 20 Jul 2026 20:20:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784578817; 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=rxzDOKNPUDIvQcipWoGks3EF5QiPZoRLwyfOOcKUAxJmPDPBD1BQcm3OjW+UONvZi5AKDo Yuyzul94xV/6HaQBlG/Lv+xRRzKIgkXbe5LA2IZOzqjfXpXwrZF1d+zU/52oFP1XpPr3vz jl6yNp2wsmRxVjGefRSOqL1J5k89U+HeJve3i9K4O5cXS7v1mhkhG7KyvGUBd0AigKUnoh 4vAKfpOHT3XtTQmGkdlARNFYo/qLjvMBS3cuktLtSB/ZCP4Qr9WVXvwnGdqPCt/ZFEd/CE BCFPSwJFPkl1TeenYBMplrbbCUf88uINUU13q7+6QX5AXgCLSt/KK64WMsAP2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784578817; a=rsa-sha256; cv=none; b=Cf+djnPE/ytCGJA6k/MwRNr5WQI1sW4MHIjQUvfoPsVYTDkW2go4ntgvbP1z9n7qufo79r rb7O7tFghew7Tjbnnd0B8WVaN0HfKU111xZaCTWb6mxcT5ZUmSwlfjppthwKt0MmG31FkK vEdRT5VWoW7HdY05bXCuPE3nr7BjpLeCnDflhTPtT1b0UCrzYA3Al/SYs6RnMKyoRbMZxc +0nPD6Ros7h0DI3brS38C/tH/Me5ii84DVXUQ9rUNGMOoJKtJuWswfTupKrN+PbSfuZeRY H4evbGpI9UprgO47sBPFPV+CNaP92SAq2LMiLrIOleitm8qAt4CvqBmE/urJ6Q== 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=1784578817; 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=RBGyQJjESZj/z+v/Zfi0Xy05anwSN8Hn4Eo6bj56YB7k37UKGRgBuA/g8USrKN6RmyHG1T qRwT9gqSJ1zciOtmeMCa3PxMw+lge7QxyUwABSlkCYumoggGuA77GKE/nthOWeLl5B78AD lEqBtAekImZfFW7BJyL7NaRFqxdlTfEmp/4zcLOlvMhDn+VCC5/Yx7uA3kfmM3djAyNw39 YKH2z4VhiCYyb+AajIFz+M/H878KPnFR8aIaRfAcHy+5O/mVlZ2lRdF5ImOnpH8DrKQWal 7EDfgLFSCLWDEUSfeNKES1srsey3T7JoVrVWrTBWZMSnd7h2/zKV0r8DWqJEtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h3sMN6Rmzz27R 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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.