Re: select() clobbering the timeout

Carlos Costa Portela (ccosta@servidores.net)
Tue, 11 May 1999 20:33:22 +0200 (CET)


On Tue, 11 May 1999, Alex Buell wrote:

> On Mon, 10 May 1999, Roger Espel Llima wrote:
>
> > $ ./mintest 0 1000
> > tv_sec = 0, tv_usec = 1000
> > tv_sec = 20936492, tv_usec = 650000
> > $ ./mintest 1 0
> > tv_sec = 1, tv_usec = 0
> > tv_sec = 20936484, tv_usec = 550000
> > $ ./mintest 2 0
> > tv_sec = 2, tv_usec = 0
> > ^C
> > tv_sec = 1, tv_usec = 570000
>
> tahallah[alex]:/home/alex/src/Linux/timeout > uname -a
> Linux tahallah 2.2.7 #20 SMP Thu Apr 29 21:26:02 BST 1999 i686
> tahallah[alex]:/home/alex/src/Linux/timeout > timeout 0 1000
> tv_sec = 0, tv_usec = 1000
> tv_sec = 0, tv_usec = 0
> tahallah[alex]:/home/alex/src/Linux/timeout > timeout 0 10000
> tv_sec = 0, tv_usec = 10000
> tv_sec = 0, tv_usec = 0
> tahallah[alex]:/home/alex/src/Linux/timeout > timeout 1 0
> tv_sec = 1, tv_usec = 0
> tv_sec = 0, tv_usec = 0
> tahallah[alex]:/home/alex/src/Linux/timeout > timeout 2 0
> tv_sec = 2, tv_usec = 0
> tv_sec = 0, tv_usec = 0
>
> Seems to behave differently in 2.2.x kernels.

Not only there:

aragorn[~/programas/timeout]% uname -a
Linux aragorn 2.0.35 #1 sáb oct 10 13:02:33 CEST 1998 i686 unknown
aragorn[~/programas/timeout]% ./ptime 0 1000
tv_sec = 0, tv_usec = 1000
tv_sec = 0, tv_usec = 0
aragorn[~/programas/timeout]% ./ptime 1 0
tv_sec = 1, tv_usec = 0
tv_sec = 0, tv_usec = 0
aragorn[~/programas/timeout]% ./ptime 2 0
tv_sec = 2, tv_usec = 0
tv_sec = 0, tv_usec = 0

:-?

Regards,
Carlos.

--
          All about C Programming: http://ccp.servidores.net/c
 _______Carlos Costa Portela_______________Password Technologies______ 
|   e-mail:  ccosta@servidores.net  |     http://www.registros.net    |
|   www: http://ccp.servidores.net  |     http://www.avisaboe.com     |
|http://compuconsejos.servidores.net|   http://moana.servidores.net   |
|__Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/