From nobody Mon Aug 11 16:18:52 2025 X-Original-To: freebsd-current@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 4c10Fq3KRhz64S2S for ; Mon, 11 Aug 2025 16:19:27 +0000 (UTC) (envelope-from andrew1tree@gmail.com) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c10Fp4S83z44J1 for ; Mon, 11 Aug 2025 16:19:26 +0000 (UTC) (envelope-from andrew1tree@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="KJce/bkV"; spf=pass (mx1.freebsd.org: domain of andrew1tree@gmail.com designates 2607:f8b0:4864:20::22e as permitted sender) smtp.mailfrom=andrew1tree@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-435a92d7b64so645684b6e.1 for ; Mon, 11 Aug 2025 09:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754929164; x=1755533964; darn=freebsd.org; h=to:date:message-id:subject:mime-version:from :content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=Q2mZvmS/sRnL+e4NxfBYGsMjqiJK33Th14YzcaKhp+s=; b=KJce/bkVSgODhVeZ7TD7xyA1u9G2nASPL7/mBeVDbNs2OTbWDTIwR81q8fsGvZAyNG F4Z4uOj1yQQolLwzWaE6MRi4Ff6uHCa1JWtK7mdbIYo7AzjAv5yGbLVAimZANzIO9vRG 1EQCU92BNjAcNCnNfHMNDS48YvGQf62qvRBdclgHB9lKGQqv2qwVTbtM6P0F8HlMZacT aNn8fwp8+fl0f/um/D7yiOmz7PPlXrNs5KIjym9EH4MDWYThUDw0whxkiAWZkuUdJpC2 LlvZqcqsNNTrEMc6HMvZkCU0egdhY7hhwh0ezimcKxxnHE3dyGmXASV7oFO0qfCA/N1y P8/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754929164; x=1755533964; h=to:date:message-id:subject:mime-version:from :content-transfer-encoding:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Q2mZvmS/sRnL+e4NxfBYGsMjqiJK33Th14YzcaKhp+s=; b=oC9W+mn2MsmZDZrAiec+HNK4uYUgne+wmoDs2tkvoU1nQP3oJzhqJ8tV+pTpMx+QHc tXzMiIkssFkIsfYtZkAGEHjH7kZS8MI64AjD41BoOYEcXXcweDnYFCCQaXr1ADUjPBfd g6lqQoX2pfT3Md5qkBnAONnHvTQ3T+vzoR2k71dDQjCUXTLgLRSdRG4NQFT7IC+dfpX7 VJXSmr+a4j1MA1K+O9nIUykw7tpor6QpQkGYmWgzOf4Vu5ctAtwGYl623eCE59XHUpez 54e5qgLQE35kIIEY5kSXe9eqFcOB5QC6qJrN1IEQ20Q8PbKk0CSLkIhTyUNDndceUmmR NCyw== X-Gm-Message-State: AOJu0YyqbDcoT/VqbkgIeKsyYGlWUzu3HdfiVwJcRJFnRloMco+HrNw2 uUSJa7QN4/87QJ+Cj5JdIL2RZJnuZASOh/QBPzKEn5lggINo+oXjpKBlpO3vpA== X-Gm-Gg: ASbGncuoRupEUsfP8i9vKxZkhxgHlVoqQlzbaimEjBPs/8h6/t0nSq28g4hq2yjZD0s SLZpPqu4mTf8v99aCWTVtl9pXmi/pmL9hv6/U8cXEiFOeVu6J5cCkPNCaBf9qn7eS9tJnzFXAfL BeI/Oij1q/+gm9G1pEXE49ZBJv18B9aCbiYanE3VTpZDwjdPG+5wanC7N1pJ35mHr9uexehWb2v r80QYrTTnW0jyWjjzUjhh4WAjeOaBagZIfZoEUQ0PQcuM9Cjl5t9rkw8pmyQaPh5ZnzOclTgn/O E7Xk4CeN5TieQfCyqDBlvkKNinWwO1tz5/C3XfZSM7iYK36zETbSMVpo1nfGmVWuPAowrY/JPSt EqYTBo03PP+N30YW3tL87rQ6ezUbg4VBLgnXzlqTWjC9NfjNb X-Google-Smtp-Source: AGHT+IFq/21luAiFUViFHr3XeHecLNV7IG2RsnhcFBWOu166aNHJRnTMQz8bnUrZRL9P3QE5HWBiLw== X-Received: by 2002:a05:6808:1781:b0:404:764:f7b6 with SMTP id 5614622812f47-435c9121589mr45007b6e.9.1754929164133; Mon, 11 Aug 2025 09:19:24 -0700 (PDT) Received: from smtpclient.apple ([171.158.163.248]) by smtp.gmail.com with ESMTPSA id 5614622812f47-434140390e9sm3532492b6e.17.2025.08.11.09.19.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Aug 2025 09:19:23 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andrew Wood List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org Mime-Version: 1.0 (1.0) Subject: Libprocstat printing warnings & errors Message-Id: <77BF12CC-B922-4B8D-BB57-F6AF95124B8E@gmail.com> Date: Mon, 11 Aug 2025 11:18:52 -0500 To: freebsd-current@freebsd.org X-Mailer: iPhone Mail (22G86) X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; APPLE_IOS_MAILER_COMMON(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::22e:from] X-Rspamd-Queue-Id: 4c10Fp4S83z44J1 X-Spamd-Bar: --- =EF=BB=BFHi all, Is it normal that a library will print errors/warnings in addition to settin= g an error/errno value on functions whose purpose isn't printing? I've been w= orking with libprocstat lately and the program I'm writing is prone to check= ing processes that no longer exist a lot of the time (but is built to handle= this), but I'm disappointed about the fact that I've seemingly got to choos= e between having my stderr riddled with warnings and disabling my ability to= use the err/warn function suite (by calling err_set_file to set it to /dev/= null). I'd much prefer if there were a separate function for finding out wha= t an error was, like perhaps a procstat_strerror function? It seems perfectl= y doable given the state tracking that's already done in the procstat struct= . Are there any design considerations to explain why a data-fetching would c= hoose to print warnings without any request to, rather than let the programm= er decide whether it's worth printing anything? Is this something I could ch= ange and make a PR for and just let any discussion over it happen there, or i= s there some person or group I need to talk to about this? Apologies if this isn't the right spot to vent about this, I'm not sure wher= e the proper place is.=