Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (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 6AA1E3C4557 for ; Thu, 2 Jul 2026 11:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782992058; cv=none; b=qDAACw+/6IvoKtyAIU59SveT0ABcgTgr6XVWp1ole2190AV2cwfL2GoYKTftzlzG0DDuqzqWb/obG1ehJOs0Ai4sSJxG977YRo6LFVbJE6jQtAGfN5OF7sBAy4wVkTe8R0Ybdw5Yg8tmJiGj1paFQgR6+9a0emugimcAmzGX9hk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782992058; c=relaxed/simple; bh=uZooiFrbg5VvLuOv6S/IUynj8EXxFm+drOZ9V7pd74g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qyH6iE1GD0MGb/rYUEuKugSdKTAPK+7fNK2SmpjC2Rfq9s7eyg02GJePJAGT5ti/Mns0egjAOo60lMH31YiXfRez4mko6XRHpIlpvXrCfhS/ylykYA1SpO43eoEuGpOp8Isy70eEwVL64TTbxS8PLgqrWSHObJjOpY2vAZ6iJpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=l5mC/3K4; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="l5mC/3K4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1782992053; bh=SGI7Ws4RNJ6aAXAFOsUR40OgGU+k/MB9PVus822ryVk=; h=From:Message-ID:From; b=l5mC/3K41sf6/oqPFWVU6XF/7inSDGStON2sJ/nQwewZptIjnY7LSa22z9iCU0V6B 6Wmg0cF/dla0SQvFU2N51Uvv3uoMZXalFD+T42Y5QtwAADO4aic+cGTPe7BCDhM7TS oupaAh3FiI36K1MslqVe87gQKDSL7hcLHhV98raI= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 84489C0A33; Thu, 02 Jul 2026 13:34:13 +0200 (CEST) Date: Thu, 2 Jul 2026 13:34:13 +0200 From: Willy Tarreau To: Daniel Palmer Cc: linux@weissschuh.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] tools/nolibc: unistd: Add readlink() Message-ID: References: <20260702085101.3304547-1-daniel@thingy.jp> <20260702085101.3304547-3-daniel@thingy.jp> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260702085101.3304547-3-daniel@thingy.jp> On Thu, Jul 02, 2026 at 05:51:00PM +0900, Daniel Palmer wrote: > Add readlink(). This is needed to test getcwd(). > > Signed-off-by: Daniel Palmer > --- > tools/include/nolibc/unistd.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h > index 2e0edbc26315..a264a20da13d 100644 > --- a/tools/include/nolibc/unistd.h > +++ b/tools/include/nolibc/unistd.h > @@ -128,6 +128,22 @@ int msleep(unsigned int msecs) > return 0; > } > > +/* > + * ssize_t readlink(const char *path, char *buf, size_t bufsiz); > + */ > + > +static __attribute__((unused)) > +ssize_t _sys_readlink(const char *path, char *buf, size_t bufsiz) > +{ > + return __nolibc_syscall4(__NR_readlinkat, AT_FDCWD, path, buf, bufsiz); > +} > + > +static __attribute__((unused)) > +ssize_t readlink(const char *path, char *buf, size_t bufsiz) > +{ > + return __sysret(_sys_readlink(path, buf, bufsiz)); > +} > + > static __attribute__((unused)) > unsigned int sleep(unsigned int seconds) > { Acked-by: Willy Tarreau Willy