This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #19371] Properly handle x32 syscall
- From: Rich Felker <dalias at libc dot org>
- To: Joseph Myers <joseph at codesourcery dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 29 Dec 2015 18:21:26 -0500
- Subject: Re: [PATCH] [BZ #19371] Properly handle x32 syscall
- Authentication-results: sourceware.org; auth=none
- References: <20151216150139 dot GA24629 at gmail dot com> <567192E1 dot 8040304 at redhat dot com> <CAMe9rOotNMw5yaoSJsB=CVk3bgdOWCEcmotty_uy07dPryCKxQ at mail dot gmail dot com> <56719372 dot 9030304 at redhat dot com> <CAMe9rOpAN+=AG9ucTUWUDMzW_dO-tizv2wX5qQA9Yf1iVWHU4g at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1512170052180 dot 7624 at digraph dot polyomino dot org dot uk> <20151221220636 dot GZ238 at brightrain dot aerifal dot cx> <20151229225338 dot GM25803 at vapier dot lan>
On Tue, Dec 29, 2015 at 05:53:38PM -0500, Mike Frysinger wrote:
> On 21 Dec 2015 17:06, Rich Felker wrote:
> > On Thu, Dec 17, 2015 at 12:53:04AM +0000, Joseph Myers wrote:
> > > On Wed, 16 Dec 2015, H.J. Lu wrote:
> > > > > Sorry, I was talking about manual/startup.texi:
> > > > >
> > > > > manual/startup.texi:727:@deftypefun {long int} syscall (long int
> > > > > @var{sysno}, @dots{})
> > > > > manual/startup.texi-728-@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
> > > > > manual/startup.texi-729-
> > > > > manual/startup.texi-730-@code{syscall} performs a generic system call.
> > > >
> > > > Here is the updated patch. OK for master?
> > >
> > > That can't possibly be right. User documentation needs to be in terms of
> > > types exposed to the user (and documented as such), not anything starting
> > > __.
> >
> > I agree, and I'm very much opposed to all the hand-waving that's been
> > done with regards to breaking documented APIs by replacing long with
> > __syscall_slong_t (which is not even a type that's supposed to be
> > exposed to userspace) in the arguments, return types, and struct
> > members of public interfaces. This makes it impossible for portable
> > code using functions that may not be posix-standard, but which are
> > widely known and available, to support x32 without arch-specific
> > #ifdeffery nonsense.
>
> syscall isn't portable. it's not in POSIX, nor are the syscall numbers
> used reliable across arches, nor are the func signatures. claiming that
I specifically meant portable across different Linux archs, not to
other different systems. But __syscall_slong_t has even crept into
places that do not require using syscall() but which have their own
documented (some of them even C11 and POSIX, e.g. timespec stuff)
interfaces. This is what I'm objecting to most strongly.
Rich