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] S390: Call direct system calls for socket operations.




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.


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