From: Richard Weinberger <richard@nod.at>
To: Jesper Juhl <jj@chaosbits.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, linux-man@vger.kernel.org
Subject: Re: st_size of a symlink
Date: Tue, 24 Jul 2012 00:07:48 +0200 [thread overview]
Message-ID: <500DCB34.6050209@nod.at> (raw)
In-Reply-To: <alpine.LNX.2.00.1207232243110.1922@swampdragon.chaosbits.net>
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
next prev parent reply other threads:[~2012-07-23 22:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 15:55 st_size of a symlink Richard Weinberger
[not found] ` <500D73FF.1070504-/L3Ra7n9ekc@public.gmane.org>
2012-07-23 18:09 ` Jesper Juhl
2012-07-23 20:22 ` Al Viro
[not found] ` <20120723202224.GH31729-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-07-23 20:47 ` Jesper Juhl
2012-07-23 22:07 ` Richard Weinberger [this message]
2012-07-23 23:13 ` Guillem Jover
[not found] ` <20120723231333.GA1299-v62vTE6/wQGgM1MOaoewpti2O/JbrIOy@public.gmane.org>
2012-07-24 10:16 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=500DCB34.6050209@nod.at \
--to=richard@nod.at \
--cc=jj@chaosbits.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).