Operating System - OpenVMS
1829010 Members
2619 Online
109986 Solutions
New Discussion

Re: pthread_cond_timedwait() errno 11 (VMS IA64 V8.2-1)

 
Olivier Hurez-Martin
Occasional Advisor

pthread_cond_timedwait() errno 11 (VMS IA64 V8.2-1)

I got into a funny situation on OpenVMS V8.2-1 Itanium with a PThread primitive pthread_cond_timedwait() returning an undocumented value 11 in errno upon error (return value -1).
This is not EINTR nor ETIMEDOUT, nor even invalid parameter error...

It looks like this occurs all the time for one of my threads, while the same primitive (called from the same wrapper function) is successful in all other threads.

I checked the parameters many times, formally, then their values under debug. All that seem just fine to me... Wonder what that errno==11 could possibly mean to pthread_cond_timedwait()
(BTW, I got a savedErrno = errno; right after the call and I am looking at the saved value... just in case...)

I'd imagine some stack corruption could lead to this... Any other possibility? Undocumented feature?

Anyone already encountered that one?

Thanks for any hint!

-- Oliver.
3 REPLIES 3
Steven Schweda
Honored Contributor

Re: pthread_cond_timedwait() errno 11 (VMS IA64 V8.2-1)

I don't know anything, but a glance at
SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]ERRNO.H
reveals:

#define EAGAIN 11 /* No more processes */

and a Google search for:
pthread_cond_timedwait EAGAIN
turns up a lot of material which is
suggestive.
Olivier Hurez-Martin
Occasional Advisor

Re: pthread_cond_timedwait() errno 11 (VMS IA64 V8.2-1)

Thanks for the fast reply :-)

I am aware of it but this error code does not make much sense for that particular library call. I'd expect it to be a valid errno value for something like vfork(), that creates sub-processes...

The documentation lists possible errno values after pthread_cond_timedwait() and 11 [EAGAIN] is not part of those :-/


Extract from doc.:

0 Successful completion.

[EINVAL] The value specified by cond, mutex, or abstime is invalid, or different mutexes are supplied for concurrent
pthread_cond_timedwait() operations or
pthread_cond_wait() operations on the same condition variable, or the mutex was not owned by the calling thread at the time of the call.

[ETIMEDOUT] The time specified by abstime expired.

[ENOMEM] The Threads Library cannot acquire memory needed to block using a statically initialized condition variable.



Olivier Hurez-Martin
Occasional Advisor

Re: pthread_cond_timedwait() errno 11 (VMS IA64 V8.2-1)

Never mind...

Looks like I am looking at POSIX doc. and this is really implemented in draft 4 variant. So EAGAIN is valid...

Google brings some of the D4 docs up indeed for that search.

Thanks for the trigger :-)