From owner-cvs-all@FreeBSD.ORG Wed Mar 9 00:10:02 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 B050116A4CE; Wed, 9 Mar 2005 00:10:02 +0000 (GMT) Received: from www.portaone.com (support.portaone.com [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF4B743D39; Wed, 9 Mar 2005 00:10:01 +0000 (GMT) (envelope-from sobomax@portaone.com) Received: from [192.168.0.254] ([192.168.2.2]) (authenticated bits=0) by www.portaone.com (8.12.11/8.12.11) with ESMTP id j2909x23078846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Mar 2005 01:10:00 +0100 (CET) (envelope-from sobomax@portaone.com) Message-ID: <422E3EC1.4050402@portaone.com> Date: Wed, 09 Mar 2005 02:09:37 +0200 From: Maxim Sobolev Organization: Porta Software Ltd User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alfred Perlstein References: <200503070726.j277Qhp5059059@repoman.freebsd.org> <20050308012939.GP11079@elvis.mu.org> <422DCF52.6080109@portaone.com> <20050308210414.GU11079@elvis.mu.org> <20050308232209.GX11079@elvis.mu.org> In-Reply-To: <20050308232209.GX11079@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/685/Wed Jan 26 10:08:24 2005 clamav-milter version 0.80j on www.portaone.com X-Virus-Status: Clean 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: Wed, 09 Mar 2005 00:10:02 -0000 Looks fine, though it's hard for me to comment about adding yet another flag that not present in standards. However, in my pretty unauthoritative opinion, since Linux has it, while many people and ISVs out there use it as a sort of reference when developing free software, it will probably make sense to support it as well, especially considering that it's pretty easy to do. In any case, since it's definitelty an API/ABI change (programs that use MSG_NOSIGNAL won't compile on older systems, while binary programs that use it may not work correctly on older systems) it also warrants __FreeBSD_version bump and proper documentation in the Porter's Handbook. Also the ABI argument probably puts MFC out of question. Thanks! -Maxim Alfred Perlstein wrote: > * 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 > > /* > > >