TEST/REVIEW: minor improvement to linux-o-lator

From: Poul-Henning Kamp (phk_at_phk.freebsd.dk)
Date: 06/30/04

  • Next message: Andre Guibert de Bruet: "Re: current kernel compile error (USB)"
    To: current@freebsd.org
    Date: Wed, 30 Jun 2004 14:40:41 +0200
    
    

    While digging through the COMPAT_* tangle, I found a couple of
    cases where we could wean the linux-o-lators from COMPAT_43:

    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:21:10 -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 {
    @@ -889,6 +893,8 @@
                     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.
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Andre Guibert de Bruet: "Re: current kernel compile error (USB)"

    Relevant Pages

    • Re: Whats the point of __KERNEL_SYSCALLS__?
      ... retrieving revision 1.4 ... diff -u -p -r1.4 process.c ... -static int errno; ... * calls - which means inline code for fork too, ...
      (Linux-Kernel)
    • New Patch [was: Re: cvs rm sys/posix4 && enable sem]
      ... posix4/sched.h to sys/psched.h in this patch). ... "steps" as, in place of a repo-copy, I'll commit the diff to ... retrieving revision 1.2 ... +To compile this driver into the kernel, ...
      (freebsd-arch)
    • CONFIG_64_BIT
      ... retrieving revision 1.3 ... diff -u -p -r1.3 Kconfig ... config MMU ...
      (Linux-Kernel)
    • Re: vmstats entries type
      ... while updating the 64-bit per cpu counters. ... retrieving revision 1.80 ... diff -u -r1.80 vmstat.c ...
      (freebsd-current)
    • cvs rm sys/posix4 && enable sem
      ... diff -u -r1.265 Makefile ... retrieving revision 1.40 ... .Ft int ... +To compile this driver into the kernel, ...
      (freebsd-arch)