You might also want to look at sem_wait(). It will return, when GDB is attached, but it won't return EINTR, so there's no way to loop on EINTR and ignore the event. Makes it really hard to attach the debugger to a program that uses semaphores. -- George T. Talbot <george@moberg.com>