From owner-cvs-all@FreeBSD.ORG Tue Mar 8 23:22:10 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A4C516A4CE; Tue, 8 Mar 2005 23:22:10 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AD5B43D2F; Tue, 8 Mar 2005 23:22:10 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 05A8A5C98B; Tue, 8 Mar 2005 15:22:10 -0800 (PST) Date: Tue, 8 Mar 2005 15:22:09 -0800 From: Alfred Perlstein To: Maxim Sobolev Message-ID: <20050308232209.GX11079@elvis.mu.org> References: <200503070726.j277Qhp5059059@repoman.freebsd.org> <20050308012939.GP11079@elvis.mu.org> <422DCF52.6080109@portaone.com> <20050308210414.GU11079@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050308210414.GU11079@elvis.mu.org> User-Agent: Mutt/1.4.2.1i cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/compat/linux linux_socket.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2005 23:22:10 -0000 * Alfred Perlstein [050308 13:04] wrote: > * Maxim Sobolev [050308 08:14] wrote: > > Alfred Perlstein wrote: > > >Why not just expand our API to do this as well? It shouldn't be > > >that hard and then we'll gain the additional functionality. > > > > I have been erroneously assuming that it would be much harder to do, but > > closer investigation is revealed that it's very simple to do. > > > > Committed, thank you for suggestion! > > You rule, thank you! I was about to update the docs to include it as part of our API, but then noticed you left it behind #ifdef _KERNEL, what about taking it out? I've taken it out and added documentation, can you review this? Index: lib/libc/sys/send.2 =================================================================== RCS file: /home/ncvs/src/lib/libc/sys/send.2,v retrieving revision 1.30 diff -u -r1.30 send.2 --- lib/libc/sys/send.2 13 Feb 2005 22:25:13 -0000 1.30 +++ lib/libc/sys/send.2 8 Mar 2005 23:19:18 -0000 @@ -103,11 +103,12 @@ .Fa flags argument may include one or more of the following: .Bd -literal -#define MSG_OOB 0x1 /* process out-of-band data */ -#define MSG_PEEK 0x2 /* peek at incoming message */ -#define MSG_DONTROUTE 0x4 /* bypass routing, use direct interface */ -#define MSG_EOR 0x8 /* data completes record */ -#define MSG_EOF 0x100 /* data completes transaction */ +#define MSG_OOB 0x00001 /* process out-of-band data */ +#define MSG_PEEK 0x00002 /* peek at incoming message */ +#define MSG_DONTROUTE 0x00004 /* bypass routing, use direct interface */ +#define MSG_EOR 0x00008 /* data completes record */ +#define MSG_EOF 0x00100 /* data completes transaction */ +#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ .Ed .Pp The flag @@ -135,6 +136,9 @@ .Xr ttcp 4 ) . .Dv MSG_DONTROUTE is usually used only by diagnostic or routing programs. +.Dv MSG_NOSIGNAL +is used to prevent SIGPIPE generation when writing a socket that +may be closed. .Pp See .Xr recv 2 Index: sys/sys/socket.h =================================================================== RCS file: /home/ncvs/src/sys/sys/socket.h,v retrieving revision 1.86 diff -u -r1.86 socket.h --- sys/sys/socket.h 8 Mar 2005 16:11:41 -0000 1.86 +++ sys/sys/socket.h 8 Mar 2005 23:20:44 -0000 @@ -398,7 +398,9 @@ #endif #ifdef _KERNEL #define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ -#define MSG_NOSIGNAL 0x20000 /* for use with emulation layers */ +#endif +#if __BSD_VISIBLE +#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ #endif /* -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684