From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: [take24 0/6] kevent: Generic event handling mechanism. Date: Wed, 22 Nov 2006 14:38:50 +0300 Message-ID: <456436CA.7050809@tls.msk.ru> References: <11630606361046@2ka.mipt.ru> <45564EA5.6020607@redhat.com> <20061113105458.GA8182@2ka.mipt.ru> <4560F07B.10608@redhat.com> <20061120082500.GA25467@2ka.mipt.ru> <4562102B.5010503@redhat.com> <45622228.80803@garzik.org> <456223AC.5080400@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jeff Garzik , Evgeniy Polyakov , David Miller , Andrew Morton , netdev , Zach Brown , Christoph Hellwig , Chase Venters , Johann Borck , linux-kernel@vger.kernel.org, Alexander Viro Return-path: Received: from hobbit.corpit.ru ([81.13.94.6]:23120 "EHLO hobbit.corpit.ru") by vger.kernel.org with ESMTP id S1752790AbWKVLi7 (ORCPT ); Wed, 22 Nov 2006 06:38:59 -0500 To: Ulrich Drepper In-Reply-To: <456223AC.5080400@redhat.com> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Ulrich Drepper wrote: > Jeff Garzik wrote: >> I think we have lived with relative timeouts for so long, it would be >> unusual to change now. select(2), poll(2), epoll_wait(2) all take >> relative timeouts. > > I'm not talking about always using absolute timeouts. > > I'm saying the timeout parameter should be a struct timespec* and then > the flags word could have a flag meaning "this is an absolute timeout". > I.e., enable both uses,, even make relative timeouts the default. This > is what the modern POSIX interfaces do, too, see clock_nanosleep. Can't the argument be something like u64 instead of struct timespec, regardless of this discussion (relative vs absolute)? Compare: void mysleep(int msec) { struct timeval tv; tv.tv_sec = msec/1000; tv.tv_usec = msec%1000; select(0,0,0,0,&tv); } with void mysleep(int msec) { poll(0, 0, msec*SOME_TIME_SCALE_VALUE); } That to say: struct time{spec,val,whatever} is more difficult to use than plain numbers. But yes... existing struct timespec has an advantage of being already existed. Oh well. /mjt