This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S390: Call direct system calls for socket operations.
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 14 Oct 2015 10:02:35 +0200
- Subject: Re: [PATCH] S390: Call direct system calls for socket operations.
- Authentication-results: sourceware.org; auth=none
- References: <mvinhp$mak$1 at ger dot gmane dot org> <561CF109 dot 9030403 at linaro dot org> <alpine dot DEB dot 2 dot 10 dot 1510131202540 dot 31118 at digraph dot polyomino dot org dot uk>
On 10/13/2015 02:07 PM, Joseph Myers wrote:
On Tue, 13 Oct 2015, Adhemerval Zanella wrote:
I would prefer to not add another arch-specific implementation, but instead
use something like __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL and use accept4
directly in sysdeps/unix/sysv/linux/accept.c. Same for recv and send.
Also note that using recvfrom for recv and sendto for send is what the
linux/generic implementations do (but not accept4 for accept - I haven't
checked if that's simply because of the asm-generic syscall interface
being introduced before accept4). Maybe there's futher opportunity for
sharing with those implementations to reduce duplication?
accept also calls accept4. See <kernel-src>/net/socket.c:
SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
int __user *, upeer_addrlen)
{
return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0);
}
or:
SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
{
...
switch (call) {
...
case SYS_ACCEPT:
err = sys_accept4(a0, (struct sockaddr __user *)a1,
(int __user *)a[2], 0);
On s390, there are no direct calls for these three syscalls. Thus I have
to duplicate this behaviour to avoid the socketcall-syscall.