From owner-freebsd-current@FreeBSD.ORG Wed Jun 30 12:48:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E2E316A4CE for ; Wed, 30 Jun 2004 12:48:45 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AAD643D2D for ; Wed, 30 Jun 2004 12:48:44 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5UClRh3002519 for ; Wed, 30 Jun 2004 14:47:27 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 30 Jun 2004 14:40:41 +0200." <2323.1088599241@critter.freebsd.dk> Date: Wed, 30 Jun 2004 14:47:27 +0200 Message-ID: <2518.1088599647@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: current@freebsd.org Subject: Re: TEST/REVIEW: minor improvement to linux-o-lator X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2004 12:48:45 -0000 In message <2323.1088599241@critter.freebsd.dk>, Poul-Henning Kamp writes: > >While digging through the COMPAT_* tangle, I found a couple of >cases where we could wean the linux-o-lators from COMPAT_43: And here is the correct patch file :-) the first one was the initial editing result. Index: compat/linux/linux_socket.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_socket.c,v retrieving revision 1.45 diff -u -r1.45 linux_socket.c --- compat/linux/linux_socket.c 25 Dec 2003 09:59:02 -0000 1.45 +++ compat/linux/linux_socket.c 30 Jun 2004 12:41:45 -0000 @@ -855,11 +855,13 @@ linux_send(struct thread *td, struct linux_send_args *args) { struct linux_send_args linux_args; - struct osend_args /* { + struct sendto_args /* { int s; caddr_t buf; int len; int flags; + caddr_t to; + int tolen; } */ bsd_args; int error; @@ -870,7 +872,9 @@ bsd_args.buf = linux_args.msg; bsd_args.len = linux_args.len; bsd_args.flags = linux_args.flags; - return (osend(td, &bsd_args)); + bsd_args.to = NULL; + bsd_args.tolen = 0; + return (sendto(td, &bsd_args)); } struct linux_recv_args { @@ -884,11 +888,13 @@ linux_recv(struct thread *td, struct linux_recv_args *args) { struct linux_recv_args linux_args; - struct orecv_args /* { + struct recvfrom_args /* { int s; caddr_t buf; int len; int flags; + struct sockaddr *from; + socklen_t fromlenaddr; } */ bsd_args; int error; @@ -899,7 +905,9 @@ bsd_args.buf = linux_args.msg; bsd_args.len = linux_args.len; bsd_args.flags = linux_args.flags; - return (orecv(td, &bsd_args)); + bsd_args.from = NULL; + bsd_args.fromlenaddr = 0; + return (recvfrom(td, &bsd_args)); } static int -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.