linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/3] VFS "stat light" out of fstatat, and fine grained flags
Date: Sun, 12 Apr 2009 17:46:32 -0400	[thread overview]
Message-ID: <C7E35AFE-52D3-436E-AC15-152EA33A007B@linuxhacker.ru> (raw)
In-Reply-To: <20090412205048.GI4394@shareable.org>

Hello!

On Apr 12, 2009, at 4:50 PM, Jamie Lokier wrote:
>>   Also it adds AT_STAT_SELF flag to mean that the stat should be  
>> executed not
>>   on a path, but on the passed filedecriptor itself.
> Do you think this is more attractive?
>
>    ret = fstatat(fd, 0, &stat, AT_STAT_SELF|AT_STAT_TYPE| 
> AT_STAT_SIZE);
>
> Or this?
>    ret = fstatat(fd, 0, &stat, AT_STAT_TYPE|AT_STAT_SIZE);
> Where 0 in the path automatically means AT_STAT_SELF.
> Or this?
>    ret = fstatat(fd, AT_STAT_SELF, &stat, AT_STAT_TYPE|AT_STAT_SIZE);
> Where AT_STAT_SELF is defined as (const char *)-1 in system headers,
> to better catch null pointer application bugs.

While I think the last one might be attractive, we also need to think
about compatibility, unaware kernels would return -EFAULT if you pass  
some
nonsense as a path, which is much less useful than say nice EINVAL.

Bye,
     Oleg

  reply	other threads:[~2009-04-12 21:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 23:15 [PATCH 1/3] VFS "stat light" out of fstatat, and fine grained flags Oleg Drokin
2009-04-07 23:25 ` Jeff Garzik
2009-04-08  6:56   ` forwarding -fsdevel to -kernel (was Re: [PATCH 1/3] VFS "stat ...) flags Miklos Szeredi
2009-04-08  7:35     ` David Miller
2009-04-12 20:50 ` [PATCH 1/3] VFS "stat light" out of fstatat, and fine grained flags Jamie Lokier
2009-04-12 21:46   ` Oleg Drokin [this message]
2009-04-21 10:20     ` VFS "stat light" fstatat, inconsistent *at() function interfaces Jamie Lokier

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=C7E35AFE-52D3-436E-AC15-152EA33A007B@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).