[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lg5ym7qi.fsf@oldenburg.str.redhat.com>
Date: Mon, 12 Nov 2018 20:11:17 +0100
From: Florian Weimer <fweimer@...hat.com>
To: Daniel Colascione <dancol@...gle.com>
Cc: Zack Weinberg <zackw@...ix.com>,
"Michael Kerrisk \(man-pages\)" <mtk.manpages@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Joel Fernandes <joelaf@...gle.com>,
Linux API <linux-api@...r.kernel.org>,
Willy Tarreau <w@....eu>, Vlastimil Babka <vbabka@...e.cz>,
"Carlos O'Donell" <carlos@...hat.com>,
GNU C Library <libc-alpha@...rceware.org>
Subject: Re: Official Linux system wrapper library?
* Daniel Colascione:
> What about off_t differences? Again, it doesn't matter. From the
> *kernel's* point of view, there's one width of offset parameter per
> system call per architecture. The library I'm proposing would expose
> this parameter literally.
Does this mean the application author needs to know when to split an
off_t argument into two, and when to pass it as a single argument, and
when to insert dummy arguments for alignment, depending on the
architecture?
>> And that means you wouldn't get as much
>> decoupling from the C and POSIX standards -- both of which specify at
>> least part of those semantics -- as you want, and we would still be
>> having these arguments. For example, it would be every bit as
>> troublesome for liblinuxabi.so.1 to export set_robust_list as it would
>> be for libc.so.6 to do that.
>
> Why? Such an exported function would cause no trouble until called,
> and there are legitimate reasons for calling such a function. Not
> everyone, as mentioned, wants to write a program that relies on libc.
For that use case, a machine-readable system call ABI specification is
the only reasonable approach: Some people want inline system calls,
others want dedicated routines per system call. The calling convention
for the dedicated functions will vary, and the way errors are handled as
well. Some want connect calls to be handled by socketcall if possible,
others prefer the direct call.
The nice thing here is that once you settled for a particular approach,
the functions are really small and will not change, so there is no real
need for dynamic linking. The challenge here is to come up with a
uniform description of the system call interface for all architectures,
and for application programmer's sanity, make sure that the kernel adds
generic system calls in a single version, across all architectures.
> This stance in the paragraph I've quoted is another example of glibc's
> misplaced idealism. As I've elaborated elsewhere, people use signals
> for many purposes today. The current signals API is extremely
> difficult to use correctly in a process in which multiple unrelated
> components want to take advantage of signal-handling functionality.
> Users deserve a cleaner, modern, and safe API. It's not productive
> withhold improvements to the signal API and gate them on unrelated
> features like process handles merely because, in the personal
> judgement of the glibc maintainers, developers should use signals for
> fewer things.
The two aren't unrelated. If you take asynchronous signals out of the
picture, the design becomes simpler and easier to use.
Thanks,
Florian
Powered by blists - more mailing lists