#include "src/sys/mman/pkey_set.h"
#include "src/__support/common.h"
#include "src/__support/error_or.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/sys/mman/linux/pkey_common.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pkey_set, (int pkey, unsigned int access_rights)) {
ErrorOr<int> ret = LIBC_NAMESPACE::pkey_common::pkey_set(pkey, access_rights);
if (!ret.has_value()) {
libc_errno = ret.error();
return -1;
}
return ret.value();
}
}