Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp638060rdh; Wed, 14 Feb 2024 07:19:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCRXCuYP7SHnPqmgJeRB/f3XlX3ACb0DFfsOLnIkhCwM1RcMPiQ7IU3IeOOQTTz8R/yLrN5hyyzBiMrjwORoermQ1KB8GN0Hjl5OaUfw== X-Google-Smtp-Source: AGHT+IHCsR2yAkpWE5Hpg2cDjHznIE9dRr6Pt8DPSimdCnCiWl+eXT9i9awZAkuNfus846nRw9R6 X-Received: by 2002:a05:6a21:8cc4:b0:19e:48b6:9c43 with SMTP id ta4-20020a056a218cc400b0019e48b69c43mr4441940pzb.58.1707923963501; Wed, 14 Feb 2024 07:19:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707923963; cv=pass; d=google.com; s=arc-20160816; b=BzC4jADJTtZQOMQ7HK1YlfMSfcx7kIaJSdkyW1glp8YyQQfvuUtysCF8Vb1MZ78Rk/ auHHbSVbWynTe1rbYZvGDGOBz2fwiSocKbgrJDTpatXvVuI2Tk6oZpHdJ6bsVmCzq5F3 BXW6ze8m7lASKm4PnirLgIw5HPEz/OQtddH4kIvrirBwsw8b9x1/XrGHAIFd/ei/22c8 P/Cd6Y4vdO+gUlFkG+KIzDyDc17HKeLVLiTRVuXbuMILGkuFRpEnxCag968BvRo4aZ/1 393x1mAm1mwjZWa0i1pNwOzLQKv6eAW86s7twkga8DGaYulV6yKHvqKcGVmQXFT+YW5E 7hzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=sjNaZ841j4g6RxYfgyYgLQqSY5PTWTRIiqfkDvjZK24=; fh=chgeNcZqcAI1DJ3SPQ3k8omYll3SthWJYP4muHrs6ko=; b=re8qTr8FRBD+Wlg/r3Q4hdKZVUk3rVzuVKKmQvdfFBdk+qMmASq86U1pbpd+tnTgcI 3a8mRkUDo3GEbXroiqheOQETlm5kN/63Ulqm60zaxy1xwbJWiLfbV04o3m8bDcPvY1Yx B+JATezXPIkKV0eVEzj8Bqktok2J3/HpPEwha9QV2NT8KJKJO7B12Zpj9airCZD+vKYq cYv0GzFqXOHdL2e36Yq76aLeIXByOFIQs1y2yrm/SEezv4bbPRR58SZDhn4pqwY01R+S MH7PjAa8wJPUoZxl0ODQbMiaxL/10PddBJJqXTXtLdcSQ8m+SfybygHejBo3GU5ejiiL zTIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-65406-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65406-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUuqz5jF4ybEmc1aA5Zhnc2cjLTWvkNJdtmL3Y+tfzrM6wbbzTx/VWnySrPk2NJKmHZZsyQXpiugGzqODvbF7pkcjOtQANwIlpvX/Sy0A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r5-20020a632b05000000b005dc87112e2asi2859456pgr.733.2024.02.14.07.19.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 07:19:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65406-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-65406-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65406-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 65B1B28A90F for ; Wed, 14 Feb 2024 15:19:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AF185D8ED; Wed, 14 Feb 2024 15:19:15 +0000 (UTC) Received: from alerce.blitiri.com.ar (alerce.blitiri.com.ar [49.12.208.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CCFF5D732 for ; Wed, 14 Feb 2024 15:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.12.208.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707923954; cv=none; b=RPJF1wDME1wgWAxc+00x2cCxsZoCeDgbKAYtmfE6Gp2ie/hFeEfCNg7RMcqH4MeC6QdYn8fwXhuMVRTDrCV6kh+cNxNst+EMaJ4ZZqCQqqgDwQayjH6o1ZjNuXtsHr7DxvStLa0/rXbMxuAzjtCJOD4zR3k8HyF6bPdGfTkBrRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707923954; c=relaxed/simple; bh=LPv8oHbl0Uht0dU5YIxSCnDtDf3Dbxixsx9UtlQR0pY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EhiexFlYYEVmVCJ5bOlAzPhSaoGcPQsNc464nqEiF1ney+RqZKkfCf1AiNUt+/x2GDLl+GCb2oCxcbKAzcGm1FIT4nrYbB6gBgf9vOo55huF8d3hzoFGMItSt+NN5O1Gz2PpAR6EVZbBndOqh6czQIcvUbBk4qODJ+KrB0imh60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar; spf=pass smtp.mailfrom=sdfg.com.ar; arc=none smtp.client-ip=49.12.208.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sdfg.com.ar Received: from [192.168.0.26] by sdfg.com.ar (chasquid) with ESMTPSA tls TLS_AES_128_GCM_SHA256 (over submission+TLS, TLS-1.3, envelope from "rodrigo@sdfg.com.ar") ; Wed, 14 Feb 2024 15:19:04 +0000 Message-ID: <7f1a6ae5-be6a-4ea2-b103-8a4a7e34bf44@sdfg.com.ar> Date: Wed, 14 Feb 2024 12:19:01 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] tools/nolibc: Fix strlcat() return code and size usage To: Willy Tarreau Cc: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org References: <20240129141516.198636-1-rodrigo@sdfg.com.ar> <20240129141516.198636-3-rodrigo@sdfg.com.ar> <20240211104817.GA19364@1wt.eu> <52c52665-35f5-4111-a9d4-f8669c79bf70@sdfg.com.ar> <20240213070243.GB9530@1wt.eu> Content-Language: en-US From: Rodrigo Campos In-Reply-To: <20240213070243.GB9530@1wt.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/13/24 08:02, Willy Tarreau wrote: > Hi Rodrigo, > > On Tue, Feb 13, 2024 at 12:16:06AM +0100, Rodrigo Campos wrote: >> On 2/11/24 11:48, Willy Tarreau wrote: >>> Hi Rodrigo, > I've read it as well and I don't interpret it the same way. I'm reading it > as "if dst doesn't contain a NUL char before size, its length is considered > to be size", and the reason is explicitly explained just after: Very true, I mixed dst and source. Thanks! >> How are you measuring it there? >> >> Sorry, I'm not familiar with this :) > > Oh, sorry for not providing the detalis! I just remove "static" in front > of the function. Thanks for the examples and heuristics to keep code small :) >> I've been playing, but as I can't measure the size, I'm not sure what is >> really better. I'd like to play a little once I know how to measure it :) > > Be careful not to spend too much time on it, nm --size and objdump are > quickly addictive ;-) Haha, it is definitely addictive. I'll share some new versions in a minute.