This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]