Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jul 2004 11:35:29 +0200
From:      Jens Schweikhardt <schweikh@schweikhardt.net>
To:        Matthew George <mdg@secureworks.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: SIGURG (fwd)
Message-ID:  <20040710093529.GA3520@schweikhardt.net>
In-Reply-To: <20040709123123.T2363@localhost>
References:  <20040709123123.T2363@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 09, 2004 at 12:42:36PM -0400, Matthew George wrote:
# 
# [ no response from questions@ =\ ]
# 
# <original message>
# 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040710093529.GA3520>