Re: [PATCH 1/3] VFS "stat light" out of fstatat, and fine grained flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux