On Fri, Dec 06, 2019 at 01:33:46PM +1100, Aleksa Sarai wrote:
On 2019-11-12, Josh Triplett <josh(a)joshtriplett.org> wrote:
> It would be nice if (for instance) it was possible to compile out the
> old openat and *only* support openat2, or otherwise compile out unused
> syscalls. In general, we're watching for new code that can't be built
> out of the kernel even in "allnoconfig"/"tinyconfig".
Based on discussions with the glibc folks, it appears it's not longer
their policy to emulate syscalls in userspace due to all of the
headaches associated with it.
So while you could (with some work) emulate openat(2) with openat2(2), I
don't think there's a clear path to making openat(2) optional -- much
like open(2) didn't become optional after openat(2).
Not all embedded systems run glibc. If your userspace consists of a
single application or a small set of applications, or you compile
everything against a known set of libraryies that make all the syscalls,
you can know that either everything uses the new syscall or everything
uses the old syscall, and compile out the one you don't use.