diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2016-08-13 04:45:39 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2016-08-13 04:45:39 +0000 |
commit | 82bc57c207ffb9047474e70a069bce8b3220c74f (patch) | |
tree | b4054673506a111849efbce1d75a4a801452715f /contrib | |
parent | fbc71595f07b8d69924924279ffa850c4c3c979b (diff) | |
download | src-82bc57c207ffb9047474e70a069bce8b3220c74f.tar.gz src-82bc57c207ffb9047474e70a069bce8b3220c74f.zip |
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
Notes
Notes:
svn path=/projects/netbsd-tests-update-12/; revision=304036
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/netbsd-tests/lib/libpthread/t_mutex.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libpthread/t_mutex.c b/contrib/netbsd-tests/lib/libpthread/t_mutex.c index 55d3a0e1a468..1fcd69ed470c 100644 --- a/contrib/netbsd-tests/lib/libpthread/t_mutex.c +++ b/contrib/netbsd-tests/lib/libpthread/t_mutex.c @@ -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); } } |