svn commit: r193264 - in head/sys: amd64/linux32 compat/linux i386/linux

Dmitry Chagin dchagin at FreeBSD.org
Mon Jun 1 20:48:40 UTC 2009


Author: dchagin
Date: Mon Jun  1 20:48:39 2009
New Revision: 193264
URL: http://svn.freebsd.org/changeset/base/193264

Log:
  Implement accept4 syscall.
  
  Approved by:	kib (mentor)
  MFC after:	1 month

Modified:
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linux/linux_socket.c
  head/sys/i386/linux/linux.h

Modified: head/sys/amd64/linux32/linux.h
==============================================================================
--- head/sys/amd64/linux32/linux.h	Mon Jun  1 20:44:58 2009	(r193263)
+++ head/sys/amd64/linux32/linux.h	Mon Jun  1 20:48:39 2009	(r193264)
@@ -669,6 +669,7 @@ union l_semun {
 #define	LINUX_GETSOCKOPT	15
 #define	LINUX_SENDMSG		16
 #define	LINUX_RECVMSG		17
+#define	LINUX_ACCEPT4		18
 
 #define	LINUX_SOL_SOCKET	1
 #define	LINUX_SOL_IP		0

Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c	Mon Jun  1 20:44:58 2009	(r193263)
+++ head/sys/compat/linux/linux_socket.c	Mon Jun  1 20:48:39 2009	(r193264)
@@ -825,6 +825,21 @@ linux_accept(struct thread *td, struct l
 	    args->namelen));
 }
 
+struct linux_accept4_args {
+	int s;
+	l_uintptr_t addr;
+	l_uintptr_t namelen;
+	int flags;
+};
+
+static int
+linux_accept4(struct thread *td, struct linux_accept4_args *args)
+{
+
+	return (linux_accept_common(td, args->s, args->addr,
+	    args->namelen, args->flags));
+}
+
 struct linux_getsockname_args {
 	int s;
 	l_uintptr_t addr;
@@ -1528,7 +1543,8 @@ static const unsigned char lxs_args[] = 
 	LINUX_AL(4) /* recv */,		LINUX_AL(6) /* sendto */,
 	LINUX_AL(6) /* recvfrom */,	LINUX_AL(2) /* shutdown */,
 	LINUX_AL(5) /* setsockopt */,	LINUX_AL(5) /* getsockopt */,
-	LINUX_AL(3) /* sendmsg */,	LINUX_AL(3) /* recvmsg */
+	LINUX_AL(3) /* sendmsg */,	LINUX_AL(3) /* recvmsg */,
+	LINUX_AL(4) /* accept4 */
 };
 
 #define	LINUX_AL_SIZE	sizeof(lxs_args) / sizeof(lxs_args[0]) - 1
@@ -1582,6 +1598,8 @@ linux_socketcall(struct thread *td, stru
 		return (linux_sendmsg(td, arg));
 	case LINUX_RECVMSG:
 		return (linux_recvmsg(td, arg));
+	case LINUX_ACCEPT4:
+		return (linux_accept4(td, arg));
 	}
 
 	uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);

Modified: head/sys/i386/linux/linux.h
==============================================================================
--- head/sys/i386/linux/linux.h	Mon Jun  1 20:44:58 2009	(r193263)
+++ head/sys/i386/linux/linux.h	Mon Jun  1 20:48:39 2009	(r193264)
@@ -645,6 +645,7 @@ union l_semun {
 #define	LINUX_GETSOCKOPT	15
 #define	LINUX_SENDMSG		16
 #define	LINUX_RECVMSG		17
+#define	LINUX_ACCEPT4		18
 
 #define	LINUX_SOL_SOCKET	1
 #define	LINUX_SOL_IP		0


More information about the svn-src-all mailing list