Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2005 20:24:59 -0600
From:      "Christian S.J. Peron" <csjp@freebsd.org>
To:        David Xu <davidxu@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: resolver un-conditionally restarts interrupted kevent
Message-ID:  <20050127022459.GA63961@wnpgmb11dc1-164-159.dynamic.mts.net>
In-Reply-To: <41F84C25.60903@freebsd.org>
References:  <20050127012401.GB48521@freefall.freebsd.org> <41F84C25.60903@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 27, 2005 at 10:04:21AM +0800, David Xu wrote:
> Because they can not be simply restarted. those interfaces
> have in/out parameters which may already be changed by kernel
> before returning, also a timeout wait can not be restarted, you
> told kernel to sleep 10 minutes, and at minute 9, it gets a signal
> and is restarted, it will return to user code after totally 19
> minutes.

Ok, that makes sense

> 
> >	2) why do we unconditionally restart kevent in our
> >	   resolver code?
> >
> I think that's right because the code checks 'n < 0' first,
> it got nothing and does timeout calculation by itself, that's OK.

The problem is this breaks many programs which use loops and conditions
for program termination. Some examples are ping(8) and tcpdump(1).

I.E. you go to ping some host or process some packets without -n and
try to ctrl+c to interrupt the process, the program will not terminate
because the resolver keeps restarting the kevent system call.

Does anyone think it would make sense to not un-conditionally restart
the system call and have EINTR (or something to this effect) propogate
back to the process through h_errno?

--
Christian S.J. Peron
csjp@FreeBSD.ORG
FreeBSD Committer



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