diff options
| author | Jackson Stogel <jtstogel@gmail.com> | 2025-11-18 14:30:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-18 14:30:15 -0800 |
| commit | db71cc58ec9471c67c6b80996930a19222dd9f03 (patch) | |
| tree | 61e6f425b2439bbff2d0e7186ff8d4a5c1b7f16a /libc/include | |
| parent | 6665642ce40c70b65624a5aa67566725c5a87da5 (diff) | |
[libc] Implement pkey_alloc/free/get/set/mprotect for x86_64 linux (#162362)
This patch provides definitions for `pkey_*` functions for linux x86_64.
`pkey_alloc`, `pkey_free`, and `pkey_mprotect` are simple syscall
wrappers. `pkey_set` and `pkey_get` modify architecture-specific
registers. The logic for these live in architecture specific
directories:
* `libc/src/sys/mman/linux/x86_64/pkey_common.h` has a real
implementation
* `libc/src/sys/mman/linux/generic/pkey_common.h` contains stubs that
just return `ENOSYS`.
Diffstat (limited to 'libc/include')
| -rw-r--r-- | libc/include/sys/mman.yaml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libc/include/sys/mman.yaml b/libc/include/sys/mman.yaml index 8c207552f980..f9ab0c1001c3 100644 --- a/libc/include/sys/mman.yaml +++ b/libc/include/sys/mman.yaml @@ -101,6 +101,41 @@ functions: arguments: - type: void * - type: size_t + - name: pkey_alloc + standards: + - Linux + return_type: int + arguments: + - type: unsigned int + - type: unsigned int + - name: pkey_free + standards: + - Linux + return_type: int + arguments: + - type: int + - name: pkey_get + standards: + - GNU + return_type: int + arguments: + - type: int + - name: pkey_mprotect + standards: + - Linux + return_type: int + arguments: + - type: void * + - type: size_t + - type: int + - type: int + - name: pkey_set + standards: + - GNU + return_type: int + arguments: + - type: int + - type: unsigned int - name: posix_madvise standards: - POSIX |
