Message ID | 20100314161159.GA23007@stro.at |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
Well, on sparc32 we implement sys_socketcall() and on sparc64 we don't and instead provide the direct system calls for things like that. What's the trouble? -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: David Miller <davem@davemloft.net> Date: Sun, 14 Mar 2010 15:06:38 -0700 (PDT) > > Well, on sparc32 we implement sys_socketcall() and on sparc64 we don't > and instead provide the direct system calls for things like that. Wait a second, both sparc64 and sparc32 provide sys_socketcall. Look in the compat syscall table for sys32_socketcall and in the native 64-bit one we have sys_socketcall. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: David Miller <davem@davemloft.net> Date: Sun, 14 Mar 2010 15:35:40 -0700 (PDT) > From: David Miller <davem@davemloft.net> > Date: Sun, 14 Mar 2010 15:06:38 -0700 (PDT) > >> >> Well, on sparc32 we implement sys_socketcall() and on sparc64 we don't >> and instead provide the direct system calls for things like that. > > Wait a second, both sparc64 and sparc32 provide sys_socketcall. > > Look in the compat syscall table for sys32_socketcall and in > the native 64-bit one we have sys_socketcall. The fact of the matter is that on sparc64 some, but unfortunately not all, of the socket system calls are provided natively. However, in my tree for sparc64, unlike the klibc commit message claims, I do in fact see sys_socket provided in slot 97. /*90*/ .word sys_dup2, sys_nis_syscall, sys_fcntl, sys_select, sys_nis_syscall .word sys_fsync, sys_setpriority, sys_socket, sys_connect, sys_accept But things like sys_bind do not appear in the sparc64 syscall table. So probably the best thing to do is, like the commit presented at the top of this thread, use sys_socketcall unconditionally. From some simple tests this is what glibc does too. But the factual errors in the commit message need to be fixed :-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 03/14/2010 03:45 PM, David Miller wrote: > > So probably the best thing to do is, like the commit presented > at the top of this thread, use sys_socketcall unconditionally. > From some simple tests this is what glibc does too. > It's worth noting that if the syscall number macros for unimplemented system calls are removed, then klibc will automatically use socketcall for the remaining calls. It is always a major headache when an architecture breaks automation by advertising a system call and then not actually implementing it. -hpa -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def index c12d525..0599dac 100644 --- a/usr/klibc/SYSCALLS.def +++ b/usr/klibc/SYSCALLS.def @@ -259,4 +259,9 @@ int sysinfo(struct sysinfo *); * system calls. */ <?!i386> long socketcall::__socketcall(int, const unsigned long *); +#if !defined(__sparc__) && !defined(__arch64__) +/* + * SPARC does not have direct syscalls for socket + */ #include "SOCKETCALLS.def" +#endif diff --git a/usr/klibc/socketcalls.pl b/usr/klibc/socketcalls.pl index e6f75ab..01993e8 100644 --- a/usr/klibc/socketcalls.pl +++ b/usr/klibc/socketcalls.pl @@ -63,7 +63,7 @@ while ( defined($line = <FILE>) ) { print OUT "#include \"socketcommon.h\"\n"; print OUT "\n"; - print OUT "#ifndef __NR_${name}\n\n"; + print OUT "#if (defined(__sparc__) && !defined(__arch64__)) || !defined __NR_${name}\n\n"; print OUT "extern long __socketcall(int, const unsigned long *);\n\n";