Date: Sat, 13 Aug 2016 04:38:38 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 211802] pthread_mutexattr_setprioceiling fails with EINVAL if m_protocol != PTHREAD_PRIO_PROTECT Message-ID: <bug-211802-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211802 Bug ID: 211802 Summary: pthread_mutexattr_setprioceiling fails with EINVAL if m_protocol !=3D PTHREAD_PRIO_PROTECT Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: ngie@FreeBSD.org One of the new NetBSD tests initializes a pthread_mutexattr, then tests out priority ceiling manipulation via pthread_mutexattr_getprioceiling/pthread_mutexattr_setprioceiling . Unfortunately the test fails with EINVAL because of a check made in lib/libthr/thr_mutexattr.c: 230 int 231 _pthread_mutexattr_getprioceiling(pthread_mutexattr_t *mattr, int *prioceiling) 232 { 233 int ret =3D 0; 234=20 235 if (mattr =3D=3D NULL || *mattr =3D=3D NULL) 236 ret =3D EINVAL; 237 else if ((*mattr)->m_protocol !=3D PTHREAD_PRIO_PROTECT) 238 ret =3D EINVAL; 239 else 240 *prioceiling =3D (*mattr)->m_ceiling; 241=20 242 return (ret); 243 } 244=20 245 int 246 _pthread_mutexattr_setprioceiling(pthread_mutexattr_t *mattr, int prioceiling) 247 { 248 int ret =3D 0; 249=20 250 if (mattr =3D=3D NULL || *mattr =3D=3D NULL) 251 ret =3D EINVAL; 252 else if ((*mattr)->m_protocol !=3D PTHREAD_PRIO_PROTECT) 253 ret =3D EINVAL; 254 else 255 (*mattr)->m_ceiling =3D prioceiling; 256=20 257 return (ret); 258 } opengroup.org [1] and the pthread*(3) [2] manages don't state why m_protocol being set to PTHREAD_PRIO_PROTECT would cause the functions to return EINVA= L. 1. https://www.freebsd.org/cgi/man.cgi?apropos=3D0&sektion=3D3&query=3Dpthread= _mutexattr&manpath=3DFreeBSD+7.0-current&format=3Dhtml 2. http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutexattr_= getprioceiling.html --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211802-8>