Expect :mutexattr2 to fail on FreeBSD
pthread_mutexattr_getprioceiling and pthread_mutexattr_setprioceiling both return EINVAL if ->m_protocol != PTHREAD_PRIO_PROTECT. The reasoning behind this decision isn't documented in neither the FreeBSD nor the OpenGroup manpages. Add printf's to add in debugging the issue PR: 211802 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
fbc71595f0
commit
82bc57c207
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/netbsd-tests-update-12/; revision=304036
@ -553,14 +553,31 @@ ATF_TC_BODY(mutexattr2, tc)
|
||||
{
|
||||
pthread_mutexattr_t mattr;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
atf_tc_expect_fail("fails on i == 0 with: "
|
||||
"pthread_mutexattr_setprioceiling(&mattr, i): Invalid argument "
|
||||
"-- PR # 211802");
|
||||
#endif
|
||||
|
||||
PTHREAD_REQUIRE(pthread_mutexattr_init(&mattr));
|
||||
int max_prio = sched_get_priority_max(SCHED_FIFO);
|
||||
int min_prio = sched_get_priority_min(SCHED_FIFO);
|
||||
for (int i = min_prio; i <= max_prio; i++) {
|
||||
int prioceiling;
|
||||
#ifdef __FreeBSD__
|
||||
int protocol;
|
||||
|
||||
PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr,
|
||||
&protocol));
|
||||
|
||||
printf("priority: %d\nprotocol: %d\n", i, protocol);
|
||||
#endif
|
||||
PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i));
|
||||
PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr,
|
||||
&prioceiling));
|
||||
#ifdef __FreeBSD__
|
||||
printf("prioceiling: %d\n", prioceiling);
|
||||
#endif
|
||||
ATF_REQUIRE_EQ(i, prioceiling);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user