[BACK]Return to uipc_socket.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/uipc_socket.c between version 1.183 and 1.190

version 1.183, 2009/01/15 15:29:10 version 1.190, 2009/09/11 22:06:29
Line 1 
Line 1 
 /*      $NetBSD$        */  /*      $NetBSD$        */
   
 /*-  /*-
  * Copyright (c) 2002, 2007, 2008 The NetBSD Foundation, Inc.   * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.   * All rights reserved.
  *   *
  * This code is derived from software contributed to The NetBSD Foundation   * This code is derived from software contributed to The NetBSD Foundation
  * by Jason R. Thorpe of Wasabi Systems, Inc.   * by Jason R. Thorpe of Wasabi Systems, Inc, and by Andrew Doran.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions   * modification, are permitted provided that the following conditions
Line 95  __KERNEL_RCSID(0, "$NetBSD$");
Line 95  __KERNEL_RCSID(0, "$NetBSD$");
   
 #ifdef COMPAT_50  #ifdef COMPAT_50
 #include <compat/sys/time.h>  #include <compat/sys/time.h>
 #define SO_OSNDTIMEO    0x1005  #include <compat/sys/socket.h>
 #define SO_ORCVTIMEO    0x1006  
 #endif  #endif
   
 #include <uvm/uvm.h>  #include <uvm/uvm.h>
Line 556  fsocreate(int domain, struct socket **so
Line 555  fsocreate(int domain, struct socket **so
 }  }
   
 int  int
   sofamily(const struct socket *so)
   {
           const struct protosw *pr;
           const struct domain *dom;
   
           if ((pr = so->so_proto) == NULL)
                   return AF_UNSPEC;
           if ((dom = pr->pr_domain) == NULL)
                   return AF_UNSPEC;
           return dom->dom_family;
   }
   
   int
 sobind(struct socket *so, struct mbuf *nam, struct lwp *l)  sobind(struct socket *so, struct mbuf *nam, struct lwp *l)
 {  {
         int     error;          int     error;
Line 681  soclose(struct socket *so)
Line 693  soclose(struct socket *so)
                         if ((so->so_state & SS_ISDISCONNECTING) && so->so_nbio)                          if ((so->so_state & SS_ISDISCONNECTING) && so->so_nbio)
                                 goto drop;                                  goto drop;
                         while (so->so_state & SS_ISCONNECTED) {                          while (so->so_state & SS_ISCONNECTED) {
                                 error = sowait(so, so->so_linger * hz);                                  error = sowait(so, true, so->so_linger * hz);
                                 if (error)                                  if (error)
                                         break;                                          break;
                         }                          }
Line 1548  soshutdown(struct socket *so, int how)
Line 1560  soshutdown(struct socket *so, int how)
         return error;          return error;
 }  }
   
   int
   sodrain(struct socket *so)
   {
           int error;
   
           solock(so);
           so->so_state |= SS_ISDRAINING;
           cv_broadcast(&so->so_cv);
           error = soshutdown(so, SHUT_RDWR);
           sounlock(so);
   
           return error;
   }
   
 void  void
 sorflush(struct socket *so)  sorflush(struct socket *so)
 {  {
Line 1620  sosetopt1(struct socket *so, const struc
Line 1646  sosetopt1(struct socket *so, const struc
         case SO_REUSEPORT:          case SO_REUSEPORT:
         case SO_OOBINLINE:          case SO_OOBINLINE:
         case SO_TIMESTAMP:          case SO_TIMESTAMP:
   #ifdef SO_OTIMESTAMP
           case SO_OTIMESTAMP:
   #endif
                 error = sockopt_getint(sopt, &optval);                  error = sockopt_getint(sopt, &optval);
                 solock(so);                  solock(so);
                 if (error)                  if (error)
Line 1690  sosetopt1(struct socket *so, const struc
Line 1719  sosetopt1(struct socket *so, const struc
         case SO_ORCVTIMEO: {          case SO_ORCVTIMEO: {
                 struct timeval50 otv;                  struct timeval50 otv;
                 error = sockopt_get(sopt, &otv, sizeof(otv));                  error = sockopt_get(sopt, &otv, sizeof(otv));
                 if (error)                  if (error) {
                           solock(so);
                         break;                          break;
                   }
                 timeval50_to_timeval(&otv, &tv);                  timeval50_to_timeval(&otv, &tv);
                 opt = opt == SO_OSNDTIMEO ? SO_SNDTIMEO : SO_RCVTIMEO;                  opt = opt == SO_OSNDTIMEO ? SO_SNDTIMEO : SO_RCVTIMEO;
                 error = 0;                  error = 0;
Line 1815  sogetopt1(struct socket *so, struct sock
Line 1846  sogetopt1(struct socket *so, struct sock
         case SO_BROADCAST:          case SO_BROADCAST:
         case SO_OOBINLINE:          case SO_OOBINLINE:
         case SO_TIMESTAMP:          case SO_TIMESTAMP:
   #ifdef SO_OTIMESTAMP
           case SO_OTIMESTAMP:
   #endif
                 error = sockopt_setint(sopt, (so->so_options & opt) ? 1 : 0);                  error = sockopt_setint(sopt, (so->so_options & opt) ? 1 : 0);
                 break;                  break;
   
Line 2071  sohasoutofband(struct socket *so)
Line 2105  sohasoutofband(struct socket *so)
 {  {
   
         fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so);          fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so);
         selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, 0);          selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, NOTE_SUBMIT);
 }  }
   
 static void  static void
Line 2303  sysctl_kern_somaxkva(SYSCTLFN_ARGS)
Line 2337  sysctl_kern_somaxkva(SYSCTLFN_ARGS)
 }  }
   
 static void  static void
 sysctl_kern_somaxkva_setup()  sysctl_kern_somaxkva_setup(void)
 {  {
   
         KASSERT(socket_sysctllog == NULL);          KASSERT(socket_sysctllog == NULL);

Legend:
Removed from v.1.183  
changed lines
  Added in v.1.190

CVSweb <webmaster@jp.NetBSD.org>