lkml.org 
[lkml]   [2017]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Revised statx(2) man page for review [and AT_EMPTY_PATH question]
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...

\
 
 \ /
  Last update: 2017-04-26 17:53    [W:0.130 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site