This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 21 Aug 2015 09:29:56 -0700
- Subject: Re: [PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
- Authentication-results: sourceware.org; auth=none
- References: <20150814120014 dot GA28610 at gmail dot com> <87oaiavy2c dot fsf at igel dot home> <CAMe9rOoP9GPP+i6xbAXwHffwr+KOKNhV=FsJ5sx=G2bM_1SE+g at mail dot gmail dot com> <87oai9vkg7 dot fsf at igel dot home> <CAMe9rOqPmsPPR7RPbdhMKh-cRxK_J2dphmECdvq0QHtfnLgz0w at mail dot gmail dot com> <87k2sxvjh8 dot fsf at igel dot home> <CAMe9rOrbhzbxg2ed3w0i7zE7=KM1q37DtR1vAY_Lk=rxsJ_8mA at mail dot gmail dot com> <87d1ypvixm dot fsf at igel dot home> <CAMe9rOqEpVE3X-drZp6W6UESV0CCAtY3Qew+SPOt1b7Y9BNwfA at mail dot gmail dot com> <878u9dvh61 dot fsf at igel dot home> <CAMe9rOqNhBrGkJCkp5xT8DebN68qzoZciWtSZzGhYo1Msyv3TQ at mail dot gmail dot com> <CAMe9rOqZ=4B698SouQm=fTLaZvsqStQRYyMMhjPNCKMbjK1Xmw at mail dot gmail dot com> <CAMe9rOqNodDbB2mi4SU6agR=-qK0yfRHyFq7BiwBeWre-gJ1tw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508211502380 dot 2039 at digraph dot polyomino dot org dot uk> <alpine dot DEB dot 2 dot 10 dot 1508211553370 dot 2039 at digraph dot polyomino dot org dot uk> <alpine dot DEB dot 2 dot 10 dot 1508211600220 dot 2039 at digraph dot polyomino dot org dot uk> <CAMe9rOoNXuFVDyWNC3OHTfPPrUW1wwkrO_HeiquLhPJxQrMJUw at mail dot gmail dot com>
On Fri, Aug 21, 2015 at 9:11 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Aug 21, 2015 at 9:07 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>> Another question: does INLINE_SYSCALL_ERROR_RETURN belong in
>> sysdeps/unix/sysdep.h at all? The interface and the comment relate to a
>> Linux error handling convention (return of negative errno values from
>> syscalls). It might be better to create sysdeps/unix/sysv/linux/sysdep.h
>> and make all Linux architectures use it.
>
> I put it there since this is where INLINE_SYSCALL is defined.
>
>> The fact that every call to INLINE_SYSCALL_ERROR_RETURN has a negation as
>> its first argument suggests that the interface itself is problematic and
>> there should be a version of the macro that takes the normal errno value,
>> not negated, and then for the cases added in your next patch where you
>> really do want to pass the Linux return value straight through, have a
>> separate variant of the macro (one macro could call the other).
>>
>
> I can add sysdeps/unix/sysv/linux/sysdep.h and define them
> here. Do want to do it?
>
One problem with sysdeps/unix/sysv/linux/sysdep.h is many
arch specific Linux sysdep.h files have things like
sysdeps/unix/sysv/linux/hppa/sysdep.h:#include <sysdeps/unix/sysdep.h>
which means adding sysdeps/unix/sysv/linux/sysdep.h requires
changes to all those sysdep.h files.
--
H.J.