This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem with 'nanosleep()'
- From: "Divy Kanungo" <divyk at bgnet dot bgsu dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 Feb 2007 05:16:43 -0500
- Subject: problem with 'nanosleep()'
Hi,
I have following piece of code that ran fine with gcc 3.x
req.tv_sec = 5;
req.tv_nsec = 10000000; //100ms
do{
rc = nanosleep(&req, &rem);
} while(rem.tv_sec != 0 || rem.tv_nsec !=0);
After upgrade to gcc 4.1.1 the above code goes to infinite loop.
is this a bug in gcc 4.x ? How do I resolve this?
Divy.