From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56080238150 for ; Sun, 19 Apr 2026 15:38:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776613112; cv=none; b=fCFaDyntJBs6IAS1IzBpItib3JE9WVjfY23wDvd3LQhljlz4wLdL0Q5B7Wa2QIG06mR1bqrpDvExCtCtGjRPgdx+HTKtWq9/nLF1u0w1YpDtRfSAc73V00exEZX4u4d+TMRB3eR3EthFzMScHg42OXycYMyRiODFmiJjUzBh2JE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776613112; c=relaxed/simple; bh=YX3hbAyKJ9CxL2685LL0W9QKTMOb2WYiyPQYyStDMbM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D//e+61l59HCTWvk+F6Hy2gwI2MjRjVqahQI2sw5n4BxA7CwndYOUBtSqGjUfEUAT3kVOF/S5rVikdO0lY2ybs5EKQxnXD+0BVBK8gzObDASbwjzG/Hl38d5UlZjECyTBc5gcJFx+nX/CpO2J9OWIOFiYGF9402epgbXrveEQm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=pZnHx17p; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="pZnHx17p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1776613107; bh=YX3hbAyKJ9CxL2685LL0W9QKTMOb2WYiyPQYyStDMbM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pZnHx17p2NAoMLc1yKi2hKBcsTkFEtXFoOXob6C/213jDW3ZT1ULVoS0qvpU8Fv6U KS8pRLx0XDdpOcOTGp5DwGqf5Mihg3Iyuyd7v3MrePIMtQY6vngtlryF936TvtidhK sXTPVbMAtUFdrnPwsAKFXY/vqU7Qgzd8SmciZuzU= Date: Sun, 19 Apr 2026 17:38:26 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau Cc: David Laight , Daniel Palmer , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] tools/nolibc: also handle _llseek system call Message-ID: References: <20260418-nolibc-largefile-v1-0-b91f0775bac3@weissschuh.net> <20260418-nolibc-largefile-v1-1-b91f0775bac3@weissschuh.net> <20260418122340.1dc07834@pumpkin> <6fe77be2-39be-4976-99d6-aced2bf3d955@weissschuh.net> <20260418170340.775bdfa7@pumpkin> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2026-04-19 17:22:37+0200, Willy Tarreau wrote: > On Sat, Apr 18, 2026 at 05:03:40PM +0100, David Laight wrote: > > On Sat, 18 Apr 2026 13:56:46 +0200 > > Thomas Weißschuh wrote: > > > > > Apr 18, 2026 13:23:43 David Laight : > > > > > > > On Sat, 18 Apr 2026 12:19:56 +0200 > > > > Thomas Weißschuh wrote: > > > > > > > >> On some architectures the llseek system call contains a leading > > > >> underscore. Also check for that one and prefer it over the lseek system > > > >> call as it is necessary for 64-bit offset handling. > > > >> > > > > ... > > > >> +#if defined(__NR_llseek) > > > >> +   nr_llseek = __NR_llseek; > > > >> +#else > > > >> +   nr_llseek = __NR__llseek; > > > >> +#endif > > > > > > > > Is that test the right way around? > > > > The commit messages says prefer _llseek, but that seems to prefer llseek. > > > > > > Yes. lseek is the ifdef case below. > > > Here we have _llseek and llseek. > > > lseek always exists, but may no handle 64 bit offsets. > > > Only one of llseek and _llseek exists > > > for one given architecture. > > > > Ok, the fact that you said 'prefer' made me think that both might > > sometimes exist. > > While I'm totally fine with the patch, I agree with David that the commit > message is misleading, as what the code does is to check for llseek and > fall back to _llseek when it is not defined, and not prefer the second > over the former. The "preference" the commit message is talking about is not the ifdeffery as quoted above. Rather it is in the *outer* ifdeffery. > The commit message should rather say something like: > > On some architectures the llseek system call contains a leading > underscore. Fall back to it when llseek is not available and use it > for the lseek system call as it is necessary for 64-bit offset handling. The preference is llseek > _llseek > lseek. The important bit is not the order of llseek vs _llseek, as these will never occurr together anyways, but that _llseek is preferred over lseek. What about: On some architectures the llseek system call contains a leading underscore. Treat it the same way as llseek and prefer it over the plain lseek system call as is necessary for 64-bit offset handling. > But overall it's an ack from me. > > Acked-by: Willy Tarreau Thanks!