[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180501152307.61113cd16c2c1bec38ac1155@linux-foundation.org>
Date: Tue, 1 May 2018 15:23:07 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk
Subject: Re: [PATCH] proc: restore seekdir("/proc", 256) semantics
On Tue, 24 Apr 2018 00:50:09 +0300 Alexey Dobriyan <adobriyan@...il.com> wrote:
> Long time ago "/proc/self" was an honest symlink and all not-PID entries
> were output before /proc/$PID. To not lose /proc/self in readdir output
> after it became permanently positive dentry it was stuck before /proc/1.
>
> One side effect of the change was that the code
>
> d = opendir("/proc");
> seekdir(d, 256);
>
> stopped pointing to the first PID for applications that want to skip all
> the crap.
>
> Later "/proc/thread-self" was added in the same way.
>
> It looks like ps and top aren't seeking over /proc but are simply
> skipping over so nobody noticed.
>
> Restore old behaviour, make seekdir(254) point to /proc/self and
> seekdir(255) point to /proc/thread-self.
>
Gee. Why? That's a pretty weird artifact in the userspace API and if
we were able to withdraw it without damage then good, let's leave it
withdrawn?
I mean, if we're to make this a permanent part of the userspace API
then it should be documented in the proc(5) manpage and we should have
something in tools/testing/selftests to detect regressions in the
interface. Good luck with all that!
Powered by blists - more mailing lists