Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754579AbdDZPxN (ORCPT ); Wed, 26 Apr 2017 11:53:13 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:42652 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbdDZPxE (ORCPT ); Wed, 26 Apr 2017 11:53:04 -0400 Date: Wed, 26 Apr 2017 16:53:00 +0100 From: Al Viro To: David Howells Cc: "Michael Kerrisk (man-pages)" , Jeff Layton , lkml , Linux API , linux-man Subject: Re: Revised statx(2) man page for review [and AT_EMPTY_PATH question] Message-ID: <20170426155259.GY29622@ZenIV.linux.org.uk> References: <14390.1493206508@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14390.1493206508@warthog.procyon.org.uk> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 726 Lines: 21 On Wed, Apr 26, 2017 at 12:35:08PM +0100, David Howells wrote: > AT_EMPTY_PATH wasn't there back in 2010. I could eliminate the: > > statx(fd, NULL, 0, ...); > > option in favour of: > > statx(fd, "", AT_EMPTY_PATH, ...); > > Any thoughts either way, Al? > > It would seem that AT_EMPTY_PATH should be redundant, though, since you can > just set the pathname pointer to NULL. NULL pathname pointer means an error for a lot of existing syscalls, so if you want to turn them into wrappers for ...at() ones at libc level, you'd need to do special-casing of NULL both kernel-side and in libc wrappers. Requiring "" + AT_EMPTY_PATH means a single dereference of userland pointer. OTOH, that's not a terrible burden...