/* Lock a read-write lock object for writing. 
See IEEE 1003.1  */
int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
/* Lock a read-write lock object for writing. 
See IEEE 1003.1  */
int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
{
	struct posix_rwlock *rwl;
	rwl = get_posix_rwlock(*rwlock);
	if (rwl == NULL) {
		return EINVAL;
	}
	return write_lock_acquire(rwl, SYS_FOREVER_MS);
}