Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.177.4.1 retrieving revision 1.177.4.3 diff -u -p -r1.177.4.1 -r1.177.4.3 --- src/sys/kern/uipc_socket.c 2009/02/02 21:04:45 1.177.4.1 +++ src/sys/kern/uipc_socket.c 2009/05/03 13:18:55 1.177.4.3 @@ -1,11 +1,11 @@ -/* $NetBSD: uipc_socket.c,v 1.177.4.1 2009/02/02 21:04:45 snj Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.177.4.3 2009/05/03 13:18:55 bouyer Exp $ */ /*- - * Copyright (c) 2002, 2007, 2008 The NetBSD Foundation, Inc. + * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. * All rights reserved. * * 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 * modification, are permitted provided that the following conditions @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.177.4.1 2009/02/02 21:04:45 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.177.4.3 2009/05/03 13:18:55 bouyer Exp $"); #include "opt_sock_counters.h" #include "opt_sosend_loan.h" @@ -1536,6 +1536,20 @@ soshutdown(struct socket *so, int how) 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 sorflush(struct socket *so) { @@ -2029,7 +2043,7 @@ sohasoutofband(struct socket *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