This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem in pthread_key_create

On Jan 10 19:36, Johnny Willemsen wrote:
> Hi Corinna,
> Thanks for the info. You are right, an EBUSY is returned when a valid key is
> passed. I wrote first the report about EBUSY, then after that of the ! Part.
> But, why EBUSY and not EINVAL? I have not figured out why a regression test
> in ACE (see calls this twice. We now get the
> error in our logfile:
> ACE_Thread::keycreate: Device or resource busy (no more keys)
> I would have expected:
> ACE_Thread::keycreate: Invalid value.
> I find the error text so strange.

I don't.  You're asking the function to recreate a key which is already
in use.  "Already in use" roughly translates to EBUSY pretty well,
doesn't it?  Also, since the standards don't define a specific error
code in this situation, you can't expect one.

However, the important sentence in the SUSv3 description is:

  It is the responsibility of the programmer to ensure that it is called
  *exactly* once per key before use of the key.

So it's arguably a bug in the above regression test.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader
Red Hat, Inc.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]