From nobody Tue Oct 28 17:28:19 2025 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 4cwy5L2Vwbz6DCmT; Tue, 28 Oct 2025 17:28:22 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cwy5L1zkGz3HGZ; Tue, 28 Oct 2025 17:28:22 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761672502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3QpUhL6e8mikm6RU6Pff8/+KzYep8QYMj85uErAivYw=; b=J8jYhg+uUy5uZ5gEofkdnFEesB7Kj4zE0Ia1+cX9D5UANNpGjer/1N1ojWyTN4jIe31mXY dkGwQaN5mz/ujFpVd9YdfSqbn1p9Mti5I4f1H5CyWTFlyXhXHCb0UfBAFo5HBUpDKHBQ0u OxpYZGYwDc3x1ypumF8yvksg7qsfHMnYw52DevjZyfbYCZvDJ84VG+wOQvV6/LU0SGvg/D 6T62zWSy0AeUKMU8u3J/kCdEb8w3wqO0bftkp6VDbIPp8dHT2PxBm5v0AlUxW69tS3Im95 6JiXCRnriSj1rDG4p/x1I/bB0gp4E2sItgnhrnb3telcRfJrm2n5wiX6y6m6+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761672502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3QpUhL6e8mikm6RU6Pff8/+KzYep8QYMj85uErAivYw=; b=qN4uAotqVmGbKXzdflJvrQyf0G4u4vOyRea3Eyds0aunjEt5dTnnWrfstlxhr1npXBOQoy Abtuu/Q0NO2APkoW089QbBFH0BrHmb8sZL8X5mw7pR8Sh/MAPnR5f907YmQHeNOpj/Fmuc Fnazt01jyAzSXbKAlEXG2u0ab/4g8NOvocZtql0/2aaF2X6ZmYVn29Mjo2IzGYDzE1+zs8 xWVMMmyztME8KbYC0Jl5JT30oD9tcxPIzxz06NBGK+qXlPQ1ARdHvLFs+OzPsFFkHRjemq yeU4BephX9onUxxSrIbWHQe0yJwHQSmKtwTRwaOJTzHeGPzysxF4NiyNayur6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761672502; a=rsa-sha256; cv=none; b=P6/0H28k0/JWHhx1mBmvHGAtf5RBRVo4qNRQA8TypAs+YlRxODvd1cJTHUlv+gKgojDH62 EfOiG5sox47O6oOU88JgtPeFrdZdpZs3PiQ3NQnXrNtm7lwjxvOYi3XLVyvXNmTigUn6KI XNEk0Ra6A/PzpZi/GYt74RI2MXvRwf07aG9OLCQivCaNjvAXAUpTWGIFvE4nENbHNmEjL8 5fJtF3T7asIkuc21Z+pMXi1vADagbv4cEGdJ8Pnza7ESp5BiUN3XAu/FUhaCKbj81NCI2u W9bhOaY9R7PFBJJvNR1uB7UXu97GDajOX8OGuVI5ZCefPE4EAwgKodAN0fxb5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cwy5K4NwQz1Cgl; Tue, 28 Oct 2025 17:28:21 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 28 Oct 2025 10:28:19 -0700 From: Gleb Smirnoff To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3d73146baeb9 - main - pwait: Add an option to print remaining processes Message-ID: References: <202510281157.59SBvhNB002870@gitrepo.freebsd.org> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202510281157.59SBvhNB002870@gitrepo.freebsd.org> On Tue, Oct 28, 2025 at 11:57:43AM +0000, Dag-Erling Smørgrav wrote: D> +static int D> +pidcmp(const struct pid *a, const struct pid *b) D> +{ D> + return (a->pid > b->pid ? 1 : a->pid < b->pid ? -1 : 0); D> +} D> + D> +RB_HEAD(pidtree, pid); D> +static struct pidtree pids = RB_INITIALIZER(&pids); D> +RB_GENERATE_STATIC(pidtree, pid, entry, pidcmp); We have a nice trick in our tree(3) that allows to use lighter compare functions. The function can return any signed integer type, thus we can: static pid_t pidcmp(const struct pid *a, const struct pid *b) { return (a->pid - b->pid); } -- Gleb Smirnoff