[PATCH 1/8] Use inline syscalls for non-cancellable versions
Roland McGrath
roland@hack.frob.com
Wed Oct 8 21:50:00 GMT 2014
> + ({ int __ret = INLINE_SYSCALL (open, 3, name, flags, mode); \
> + __ret; })
What's the purpose of the statement expression and the result variable?
Why isn't the rhs just the INLINE_SYSCALL invocation directly, or with
an (int) cast if need be?
Same for several more instances below.
> +#define __read_nocancel(fd, buf, len) \
> + ({ ssize_t __ret = INLINE_SYSCALL (read, 3, fd, buf, len); \
> + __ret; })
What's the purpose of the extra __read_nocancel macro layer?
Why isn't this just the definition of read_not_cancel?
Same for write and close, below.
> +#define waitpid_nocancel(pid, stat_loc, options) \
> INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
> +#define waitpid_not_cancel(pid, stat_loc, options) \
> + waitpid_nocancel(pid, stat_loc, options)
Here without the __ prefix the extra macro layer looks even more insane.
Thanks,
Roland
More information about the Libc-alpha
mailing list