This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos 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]

[Bug 1000329] wrong error code returned by pthread_attr_setschedpolicy


http://bugzilla.ecoscentric.com/show_bug.cgi?id=1000329


jifl@ecoscentric.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |NOTABUG




------- Additional Comments From jifl@ecoscentric.com  2006-10-20 01:50 -------
If you look more closely at the web page quoted, you will see that EINVAL
corresponds to "The value of the attribute being set is not valid", which may
sound a bit ambiguous but to me reads as the policy argument is not valid. In
fact my POSIX 2001 standard is even clearer on it by saying EINVAL is used when
"the value of policy is not valid". 

What this means to me is that there are two ways a policy can fail to be set: a
bogus value was passed in that was not a SCHED_something define in <sched.h>; or
there was a value that is SCHED_something in <sched.h> but the underlying OS
does not in fact support it or refuses to do it, despite what the headers say.
This can happen in UNIX when a kernel may not in practice implement everything
that the system C library defines as possible, or if the kernel is not able to
honour the request for some other reason.

This page, although about Linux, also indicates this behaviour:
http://docsrv.caldera.com:8457/cgi-bin/man?mansearchword=pthread_attr_init&mansection=3thr

With eCos this isn't an issue. The only defines are SCHED_RR/FIFO/OTHER which
are the minimum that POSIX requires anyway. So any other value should correspond
to EINVAL as we do not define any other scheduling policies that we would later
have to say were unsupported.

So the current code is correct and I'm marking this as NOTABUG.


-- 
Configure bugmail: http://bugzilla.ecoscentric.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


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