[RISCV] Add missing SiFive P400 scheduling model test for divisions. NFC
[llvm-project.git] / libc / src / pthread / pthread_rwlockattr_setkind_np.cpp
blob80d34a35c717adbd8eef3fd2bc446f8063ea70cc
1 //===-- Implementation of the pthread_rwlockattr_setkind_np ---------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "pthread_rwlockattr_setkind_np.h"
11 #include "src/__support/common.h"
12 #include "src/__support/macros/config.h"
13 #include "src/errno/libc_errno.h"
15 #include <pthread.h> // pthread_rwlockattr_t
17 namespace LIBC_NAMESPACE_DECL {
19 LLVM_LIBC_FUNCTION(int, pthread_rwlockattr_setkind_np,
20 (pthread_rwlockattr_t * attr, int pref)) {
22 if (pref != PTHREAD_RWLOCK_PREFER_READER_NP &&
23 pref != PTHREAD_RWLOCK_PREFER_WRITER_NP &&
24 pref != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
25 return EINVAL;
27 attr->pref = pref;
28 return 0;
31 } // namespace LIBC_NAMESPACE_DECL