This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Remove socket.S implementation
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Richard Henderson <rth at twiddle dot net>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 21 May 2015 18:03:26 -0300
- Subject: Re: [PATCH v2] Remove socket.S implementation
- Authentication-results: sourceware.org; auth=none
- References: <555E3876 dot 3010805 at linaro dot org> <555E3B7A dot 9080604 at twiddle dot net>
On 21-05-2015 17:09, Richard Henderson wrote:
> On 05/21/2015 12:56 PM, Adhemerval Zanella wrote:
>> +#define __SOCKETCALL0(__name) \
>> + INLINE_SYSCALL (socketcall, 2, __name)
>
> If there really are any zero-arg socket calls, the second argument here must be
> 1, or you must pass a second argument (null?).
>
> If there are no zero-arg socket calls, as I suspect, then remove this so that
> someone gets a compile-time error for such a typo in the argument list.
Indeed there is zero-arg socket call, so I will just remove it.
>
>
>> +#define __SOCKETCALL1(__name, __a1) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [1]) { (long int) __a1 }))
>
> (1) you don't need __ in the macros; it just messies the text.
> (2) you need parenthesis around the arguments before casting.
>
>
Right, I will fix both (1) and (2). Thanks!
> r~
>
>
>> +#define __SOCKETCALL2(__name, __a1, __a2) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [2]) { (long int) __a1, (long int) __a2 }))
>> +#define __SOCKETCALL3(__name, __a1, __a2, __a3) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [3]) { (long int) __a1, (long int) __a2, (long int) __a3 }))
>> +#define __SOCKETCALL4(__name, __a1, __a2, __a3, __a4) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [4]) { (long int) __a1, (long int) __a2, (long int) __a3, \
>> + (long int) __a4 }))
>> +#define __SOCKETCALL5(__name, __a1, __a2, __a3, __a4, __a5) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [5]) { (long int) __a1, (long int) __a2, (long int) __a3, \
>> + (long int) __a4, (long int) __a5 }))
>> +#define __SOCKETCALL6(__name, __a1, __a2, __a3, __a4, __a5, __a6) \
>> + INLINE_SYSCALL (socketcall, 2, __name, \
>> + ((long int [6]) { (long int) __a1, (long int) __a2, (long int) __a3, \
>> + (long int) __a4, (long int) __a5, (long int) __a6 }))
>