This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: posix semaphores not working under gdb
- From: Daniel Juan <daniel dot juan at gmail dot com>
- To: Kenny Simpson <theonetruekenny at yahoo dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 1 Dec 2005 14:15:53 +0100
- Subject: Re: posix semaphores not working under gdb
- References: <20051201075511.62566.qmail@web34107.mail.mud.yahoo.com>
You are right Kenny,
if you look at the doc in NTPL:
man 3p sem_wait
The sem_trywait() and sem_wait() functions shall return zero if the
calling process successfully performed the semaphore lock operation on
the semaphore designated by sem.If the call was unsuccessful, the
state of the semaphore shall be unchanged, and the function shall
return a value of -1 and set errno to indicate the error.
If you look at Linuxthreads
man 3 sem_wait
The sem_wait and sem_getvalue functions always return 0.
Thanks
On 12/1/05, Kenny Simpson <theonetruekenny@yahoo.com> wrote:
> One thing that caused me some pain a while ago is the semaphore behavioral change in NPTL vs
> LinuxThreads. Under LinuxThreads, sem_wait will never return until the semaphore is aquired.
> With NPTL, sem_wait can return EINTR
> ... and DOES when gdb attaches.
>
> The man pages in many distrubutions still have the old LinuxThreads documentation which explictly
> states that sem_wait will not be affected by signals.
>
> Hope this helps...
> -Kenny
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
--
Daniel Juan Boned
e-mail: daniel(dot)juan(at)gmail.com