sparc: use the direct socket syscalls, not the multiplexer
socketcalls.c hid the direct socket syscall numbers from sparc together
with i386:
/* exposed on x86 since Linux commit 9dea5dc921b5... */
#if defined(__sparc__) || defined(__i386__)
For i386 that is right: the direct calls only appeared in Linux 4.3, so
a libc built against newer headers would get ENOSYS on an older kernel.
sparc is a different story -- socket is 97, connect 98, accept 99,
recvmsg 113, sendmsg 114, getsockopt 118, recvfrom 125, sendto 133,
shutdown 134, socketpair 135, getpeername 141, getsockname 150, all
marked "Common" in the sparc table, i.e. there from the beginning, and
accept4 at 323 since 2.6.28. Only bind, listen and setsockopt came with
the 4.3 work, at 353..355; those keep going through the multiplexer for
the i386 reason, and none of them is a cancellation point.
Two things follow. The syscall now happens inside the cancellable
wrapper, where the unwind information is, instead of in the CFI-less
__socketcall stub -- b5638b9f3 makes that stub unwindable in any case,
but this is the cleaner shape. And it drops the multiplexer
overhead: no argument array built on the stack, no copy_from_user of
those words in sys_socketcall, no table dispatch, and on sparc no extra
register window for the call.
recv and send have no number of their own on sparc; they resolve to
__recvfrom_nocancel and __sendto_nocancel, the same way glibc builds
them out of recvfrom and sendto.
Verified on the built objects for sparc-v8 (gcc 10.5.0, 6.1.60 headers).
accept, recvfrom, recvmsg, sendto and connect now carry 3 FDEs each and
no longer reference __socketcall; recv and send reference
__recvfrom_nocancel and __sendto_nocancel, which carry their own.
Signed-off-by: Ramin Moussavi <lordrasmus@gmail.com>