From owner-freebsd-arch Fri Jun 14 10: 0:21 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 904ED37B40D; Fri, 14 Jun 2002 10:00:16 -0700 (PDT) Received: from hades.hell.gr (patr530-b178.otenet.gr [212.205.244.186]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g5EGwoxa028569; Fri, 14 Jun 2002 19:58:52 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g5EGwnFq010358; Fri, 14 Jun 2002 19:58:49 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g5EDav5A009632; Fri, 14 Jun 2002 16:36:57 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 14 Jun 2002 16:36:57 +0300 From: Giorgos Keramidas To: Mario Sergio Fujikawa Ferreira Cc: Garance A Drosihn , FreeBSD-arch@FreeBSD.org, msmith@FreeBSD.org Subject: Re: Adding SO_NOSIGPIPE to -STABLE/-CURRENT Message-ID: <20020614133656.GB9021@hades.hell.gr> References: <20020614022304.94570.qmail@exxodus.fedaykin.here> <20020614054920.1254.qmail@exxodus.fedaykin.here> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020614054920.1254.qmail@exxodus.fedaykin.here> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-06-14 02:48 -0300, Mario Sergio Fujikawa Ferreira wrote: > Darwin call it SOF_NOSIGPIPE because they use it as socket > flag as opposed to a socket option such as either SO_DONTTRUNC or > SO_WANTMORE. > > Well, Linux has it as a socket option, it looks okay > as a socket option so the name begins with SO_. SO_NOSIGPIPE > because it describes well its use as it does in Darwin. > > However, that's my opinion. I am all open to suggestions. The example you mentioned above (threaded programs that want to disable the signal for some of the threads, but not all of them) can probably be implemented in userland with: void sigpipe_handler (int signo) { if (we are a thread that needs sigpipe) { do something; } } One might argue that an option like SO_NOSIGPIPE will be faster and save all the threads from checking the same thing though, and I will agree with that. If you give a name to this option though, please don't make its use depend on a 'double negative'. It would be a lot better to have this option enabled by default, and call it SO_SIGPIPE. Then you don't have to "disable a NO_FOO" option, to "enable FOO". The only option that uses a similar negative meaning right now is SO_DONTROUTE, while all the rest are of the style "set SO_FOO to enable behavior bar". - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message