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


Here's another problem with the patch as committed, further evidence of 
the need for proper review of such changes before they go in rather than 
assuming silence means consensus.  The currently checked in eventfd.c has:

#ifdef __NR_eventfd2
# ifndef __ASSUME_EVENTFD2
  INTERNAL_SYSCALL_DECL (err);
  int res = INTERNAL_SYSCALL (eventfd2, err, 2, count, flags);
  if (!__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err))
      || INTERNAL_SYSCALL_ERRNO (res, err) != ENOSYS)
    return res;
# endif
  return INLINE_SYSCALL_RETURN (eventfd2, 2, int, count, flags);
#endif

This means: if __NR_eventfd2 is defined, but __ASSUME_EVENTFD2 isn't (on 
alpha), the code will always return after this point, never falling back 
to eventfd.  Furthermore, in the ENOSYS case, it will call the syscall 
twice in the process.  Maybe there should be a #else case instead of 
#endif?

-- 
Joseph S. Myers
joseph@codesourcery.com


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