pkey_alloc(2) System Calls Manual pkey_alloc(2) pkey_alloc, pkey_free - LIBRARY Standard C library (libc, -lc) #define _GNU_SOURCE /* feature_test_macros(7) */ #include int pkey_alloc(unsigned int flags, unsigned int access_rights); int pkey_free(int pkey); pkey_alloc() (pkey), pkey_mprotect(2). flags pkey_alloc() 0. access_rights pkey_alloc() : PKEY_DISABLE_ACCESS , . PKEY_DISABLE_WRITE , . pkey_free() . . pkey_free() , pkey_mprotect(2) . . On success, pkey_alloc() returns a positive protection key value. On success, pkey_free() returns zero. On error, -1 is returned, and errno is set to indicate the error. EINVAL pkey, flags access_rights. ENOSPC (pkey_alloc()) , . - . x86 15 . , . , pkey. Linux. Linux 4.9, glibc 2.27. pkey_alloc() . pkey; ENOSPC, pkey. , (PKRU) . ( , pkey_alloc(), pkey_free()), , . pkeys(7). . pkey_mprotect(2), pkeys(7) Alexey, Azamat Hackimov , kogamatranslator49 , Kogan, Max Is , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . pkey_alloc(2)