[6813] in bugtraq

home help back first fref pref prev next nref lref last post

Re: pingflood.c

daemon@ATHENA.MIT.EDU (Phil Stracchino)
Tue May 19 18:39:56 1998

Date: 	Mon, 18 May 1998 20:01:43 -0700
Reply-To: Phil Stracchino <alaric@BABCOM.COM>
From: Phil Stracchino <alaric@BABCOM.COM>
X-To:         pedward@WEBCOM.COM
To: BUGTRAQ@NETSPACE.ORG
In-Reply-To:  <199805181723.KAA26618@s1000e2> from "pedward@WEBCOM.COM" at "May
              18, 98 10:23:32 am"

> void mysleep(int seconds)
> {
>         struct timeval  tv;
>
>         tv.tv_sec=seconds;
>         tv.tv_usec=0;
>
>         select(0,NULL,NULL,NULL,&tv);
> }
>
> The code above should be portable to every platform that supports the standard
> select(2) semantics.  It allows for subsecond precision too.  This implementation
> isn't subject to signal dainbrammage either.


However, depending on your platform's implementation of select(), it may
consume idle CPU cycles, causing an artificially high load figure and
possibly stealing cycles from other lower-priority jobs.


--
 ----  phil stracchino  ----  the renaissance man  ----  lone geek biker  ----
   "I have a cat named Easter, he says, Will you ever learn -
    It's just an empty cage girl, if you kill the bird...."  -- Tori Amos
 ----  "Oh, bother!" said Pooh, as Sheridan decompressed the airlock....  ----

home help back first fref pref prev next nref lref last post