Cleanups for 4.4BSD-Lite
[unix-history] / usr / src / sys / kern / uipc_socket2.c
index 1b41103..1b22cbc 100644 (file)
@@ -1,22 +1,22 @@
 /*
 /*
- * Copyright (c) 1982, 1986, 1988, 1990 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1988, 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)uipc_socket2.c      7.16.1.1 (Berkeley) %G%
+ *     @(#)uipc_socket2.c      8.1 (Berkeley) %G%
  */
 
  */
 
-#include "param.h"
-#include "systm.h"
-#include "proc.h"
-#include "file.h"
-#include "buf.h"
-#include "malloc.h"
-#include "mbuf.h"
-#include "protosw.h"
-#include "socket.h"
-#include "socketvar.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/buf.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
 
 /*
  * Primitive routines for operating on sockets and socket buffers
 
 /*
  * Primitive routines for operating on sockets and socket buffers
@@ -230,27 +230,6 @@ socantrcvmore(so)
        sorwakeup(so);
 }
 
        sorwakeup(so);
 }
 
-/*
- * Socket select/wakeup routines.
- */
-
-/*
- * Queue a process for a select on a socket buffer.
- */
-sbselqueue(sb, cp)
-       struct sockbuf *sb;
-       struct proc *cp;
-{
-       struct proc *p;
-
-       if ((p = sb->sb_sel) && p->p_wchan == (caddr_t)&selwait)
-               sb->sb_flags |= SB_COLL;
-       else {
-               sb->sb_sel = cp;
-               sb->sb_flags |= SB_SEL;
-       }
-}
-
 /*
  * Wait for data to arrive at/drain from a socket buffer.
  */
 /*
  * Wait for data to arrive at/drain from a socket buffer.
  */
@@ -295,11 +274,8 @@ sowakeup(so, sb)
 {
        struct proc *p;
 
 {
        struct proc *p;
 
-       if (sb->sb_sel) {
-               selwakeup(sb->sb_sel, sb->sb_flags & SB_COLL);
-               sb->sb_sel = 0;
-               sb->sb_flags &= ~(SB_SEL|SB_COLL);
-       }
+       selwakeup(&sb->sb_sel);
+       sb->sb_flags &= ~SB_SEL;
        if (sb->sb_flags & SB_WAIT) {
                sb->sb_flags &= ~SB_WAIT;
                wakeup((caddr_t)&sb->sb_cc);
        if (sb->sb_flags & SB_WAIT) {
                sb->sb_flags &= ~SB_WAIT;
                wakeup((caddr_t)&sb->sb_cc);