RE: Official Linux system wrapper library?
From: David Laight
Date: Wed Nov 28 2018 - 08:18:49 EST
From: David Newall
> Sent: 23 November 2018 14:11
>
> On 24/11/18 12:04 am, Florian Weimer wrote:
> > But socketcall does not exist on all architectures. Neither does
> > getpid, it's called getxpid on some architectures.
> > ...
> > I think it would be a poor approach to expose application developers to
> > these portability issues. We need to abstract over these differences at
> > a certain layer, and applications are too late.
>
> Interesting. I think the opposite. I think exposing the OS's
> interfaces is exactly what a c-library should do. It might also provide
> alternative interfaces that work consistently across different
> platforms, but in addition to, not instead of the OS interface.
Also, it really shouldn't implement broken workarounds for 'missing'
system calls.
At least one C library I've met converted pread() into lseek() and read().
That is just so broken it is better to fail to link or fail at runtime.
Never mind all the fun trying to read CLOCK_MONOTONIC.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)