| Summary: | pthread_attr_setscope always fails | ||
|---|---|---|---|
| Product: | Base System | Reporter: | rblaze <rblaze> |
| Component: | misc | Assignee: | Maxim Konovalov <maxim> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.2-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Something along these lines should let PTHREAD_SCOPE_PROCESS work, I believe.
*** uthread_attr_setscope.c.old Fri Jun 15 23:28:19 2001
--- uthread_attr_setscope.c Fri Jun 15 23:47:49 2001
***************
*** 43,56 ****
int ret = 0;
if ((attr == NULL) || (*attr == NULL)) {
! /* Return an invalid argument: */
! ret = EINVAL;
! } else if ((contentionscope != PTHREAD_SCOPE_PROCESS) ||
! (contentionscope != PTHREAD_SCOPE_SYSTEM)) {
! /* We don't support PTHREAD_SCOPE_SYSTEM. */
! ret = ENOTSUP;
! } else
! (*attr)->flags |= contentionscope;
! return(ret);
}
--- 43,62 ----
int ret = 0;
if ((attr == NULL) || (*attr == NULL)) {
! return EINVAL;
! }
! switch(contentionscope)
! {
! case PTHREAD_SCOPE_SYSTEM:
! return ENOTSUP;
! case PTHREAD_SCOPE_PROCESS:
! (*attr)->flags |= contentionscope;
! return ret;
! default:
! return ENOTSUP;
! }
! /* not reached */
! return ret;
}
+
Responsible Changed From-To: freebsd-bugs->jasone I'll take a look at this. State Changed From-To: open->analyzed Duplicated with misc/30699. The fix is committed to -current. Responsible Changed From-To: jasone->maxim I will MFC the fix. State Changed From-To: analyzed->closed The fix committed to -current and -stable. |
This is code from /usr/src/lib/libc_r/uthread/uthread_attr_setscope.c : int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope) { int ret = 0; if ((attr == NULL) || (*attr == NULL)) { /* Return an invalid argument: */ ret = EINVAL;