This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/8] Use inline syscalls for non-cancellable versions
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Wed, 8 Oct 2014 14:50:25 -0700 (PDT)
- Subject: Re: [PATCH 1/8] Use inline syscalls for non-cancellable versions
- Authentication-results: sourceware.org; auth=none
- References: <5435AD71 dot 4060506 at linux dot vnet dot ibm dot com>
> + ({ 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