From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Subject: Re: st_size of a symlink Date: Tue, 24 Jul 2012 00:07:48 +0200 Message-ID: <500DCB34.6050209@nod.at> References: <500D73FF.1070504@nod.at> <20120723202224.GH31729@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Al Viro , "linux-kernel@vger.kernel.org" , linux-fsdevel@vger.kernel.org, linux-man@vger.kernel.org To: Jesper Juhl Return-path: Received: from a.ns.miles-group.at ([95.130.255.143]:47836 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723Ab2GWWHw (ORCPT ); Mon, 23 Jul 2012 18:07:52 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 23.07.2012 22:47, Jesper Juhl wrote: >> Fix it _how_? > > By returning the size as the number of bytes in the name the link is > currently pointing at. This is not easy. procfs has no clue where the link pointing at. The information is generated while accessing the link. tmpfs on the other hand has this information because symlinks get only changed through tmpfs... >> By retrying readlink() with bigger buffer. >> With procfs there's just a few more ways the readlink() output can >> change, that's all. >> > Still not a good reason to just return 0 IMHO. IMHO the lstat() and readlink() manpages have to be more precise about st_size. Thanks, //richard