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 v2] Remove socket.S implementation



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 }))
> 


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