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 14, 2015 at 10:39 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> +#define INLINE_SYSCALL_RETURN(name, nr, type, args...) \
>> +  do                                                         \
>> +    {                                                                \
>> +      return (type) INLINE_SYSCALL (name, nr, args);         \
>> +    }                                                                \
>> +  while (0)
>
> There is no point for using do while here.

I can use

#define INLINE_SYSCALL_RETURN(name, nr, type, args...)  \
   return (type) INLINE_SYSCALL (name, nr, args)

>
> Also, I don't like the hiding of return in the macro.

i386 version isn't a simple return:

#define INLINE_SYSCALL_RETURN(name, nr, type, args...) \
  do                                                                    \
    {                                                                   \
      unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);     \
      if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))    \
        INLINE_SYSCALL_ERROR_RETURN (resultvar, type, );                \
      return (type) resultvar;                                          \
    }                                                                   \
  while (0)

What is your suggestion?

-- 
H.J.


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