[PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
Joseph Myers
joseph@codesourcery.com
Fri Aug 21 15:58:00 GMT 2015
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
More information about the Libc-alpha
mailing list