From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [PATCH 1/3] VFS "stat light" out of fstatat, and fine grained flags Date: Sun, 12 Apr 2009 21:50:48 +0100 Message-ID: <20090412205048.GI4394@shareable.org> References: <20090407231524.GA1569655@fiona.linuxhacker.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Oleg Drokin Return-path: Received: from mail2.shareable.org ([80.68.89.115]:48005 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbZDLUuu (ORCPT ); Sun, 12 Apr 2009 16:50:50 -0400 Content-Disposition: inline In-Reply-To: <20090407231524.GA1569655@fiona.linuxhacker.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Oleg Drokin 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. -- Jamie