Date: Tue, 8 Mar 2005 15:22:09 -0800 From: Alfred Perlstein <alfred@freebsd.org> To: Maxim Sobolev <sobomax@portaone.com> Cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/compat/linux linux_socket.c Message-ID: <20050308232209.GX11079@elvis.mu.org> In-Reply-To: <20050308210414.GU11079@elvis.mu.org> References: <200503070726.j277Qhp5059059@repoman.freebsd.org> <20050308012939.GP11079@elvis.mu.org> <422DCF52.6080109@portaone.com> <20050308210414.GU11079@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Alfred Perlstein <alfred@freebsd.org> [050308 13:04] wrote: > * Maxim Sobolev <sobomax@portaone.com> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050308232209.GX11079>