From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 10 09:40:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7CD716A4CE for ; Sat, 10 Jul 2004 09:40:17 +0000 (GMT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DB3343D31 for ; Sat, 10 Jul 2004 09:40:17 +0000 (GMT) (envelope-from schweikh@schweikhardt.net) Received: by bremen.shuttle.de (Postfix, from userid 10) id 4D0533B926; Sat, 10 Jul 2004 11:40:16 +0200 (CEST) Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) i6A9ZTvG004569; Sat, 10 Jul 2004 11:35:29 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost)i6A9ZTdQ004568; Sat, 10 Jul 2004 11:35:29 +0200 (CEST) (envelope-from schweikh) Date: Sat, 10 Jul 2004 11:35:29 +0200 From: Jens Schweikhardt To: Matthew George Message-ID: <20040710093529.GA3520@schweikhardt.net> References: <20040709123123.T2363@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040709123123.T2363@localhost> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: SIGURG (fwd) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2004 09:40:18 -0000 On Fri, Jul 09, 2004 at 12:42:36PM -0400, Matthew George wrote: # # [ no response from questions@ =\ ] # # # I have a fairly active program that forks and uses pipes to communicate # back to the parent before exiting. When I go to wait() on the child, # occasionally the status is signaled - SIGURG instead of exit()ing # normally. It appears the child process is doing everything it needs to be # doing. # # What will generate this signal? If you use TCP sockets, then SIGURG is generated upon reception of datagrams with the TCP URG bit set along with the urgent offset. Urgent mode is requested by the sending side with the MSG_OOB flag, e.g. send (fd, "x", 1, MSG_OOB); # Is it safe to ignore, or should I be handling it somehow? You should understand why you are using/receiving out-of-band data instead of regular non-OOB data. Sending all data OOB in the hope it will get processed faster is a foolish thing to do, as urgent processing involves considerable overhead. The whole concept is explained in W.R.Stevens, Unix Programming, Vol 1, Networking APIs, Sockets and XTI, 2nd ed, Chapter 21. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped)