This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Principles for syscall wrappers, again
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: Rich Felker <dalias at libc dot org>, <libc-alpha at sourceware dot org>
- Date: Thu, 4 Jun 2015 14:53:20 +0000
- Subject: Re: Principles for syscall wrappers, again
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1505182114090 dot 16300 at digraph dot polyomino dot org dot uk> <20150519000918 dot GB17573 at brightrain dot aerifal dot cx> <1432630525 dot 3077 dot 36 dot camel at triegel dot csb> <20150526151000 dot GA17573 at brightrain dot aerifal dot cx> <alpine dot DEB dot 2 dot 10 dot 1505281648440 dot 16930 at digraph dot polyomino dot org dot uk> <1432888653 dot 30849 dot 146 dot camel at triegel dot csb> <alpine dot DEB dot 2 dot 10 dot 1505291103540 dot 2439 at digraph dot polyomino dot org dot uk> <1432900697 dot 30849 dot 178 dot camel at triegel dot csb> <alpine dot DEB dot 2 dot 10 dot 1505291301400 dot 18021 at digraph dot polyomino dot org dot uk> <1432908585 dot 30849 dot 213 dot camel at triegel dot csb> <alpine dot DEB dot 2 dot 10 dot 1505291524290 dot 27491 at digraph dot polyomino dot org dot uk> <1432923248 dot 4832 dot 40 dot camel at triegel dot csb> <alpine dot DEB dot 2 dot 10 dot 1505291951380 dot 17156 at digraph dot polyomino dot org dot uk> <1433406027 dot 21461 dot 245 dot camel at triegel dot csb>
On Thu, 4 Jun 2015, Torvald Riegel wrote:
> Also, why would anyone multiplex several logically different operations,
> with type-unsafe parameter multiplexing and all that, into a single C
> function -- instead of just using several C functions? I can't think of
> any reason but wanting to limit the number of functions/syscalls.
Well, I think ioctl is better as a libc interface than providing large
numbers of extremely specialized functions - limiting the size of the libc
interface, while still providing access to specialized operations not
known at the time the interface is added to libc, can make sense. And
then in a few cases we provide higher-level interfaces to ioctls (e.g.
termios).
> OK. I notice you said "only providing higher-level" interfaces; so, do
> I understand you correctly that you're primary concern here is to
> provide futex(), and that you don't necessarily object to a proper
> interface, nor think that offering futex() renders offering a proper
> interface obsolete?
Yes.
--
Joseph S. Myers
joseph@codesourcery.com