Unverified Commit 6946e513 authored by Jeff Bailey's avatar Jeff Bailey Committed by GitHub
Browse files

[libc] Implement sys/personality.h (#195065)

Added the personality() syscall wrapper, which sets or queries the
process execution domain. The function signature follows the Linux man
page: int personality(unsigned long persona).

New files:
* libc/include/sys/personality.{yaml,h.def}
* libc/src/sys/personality/ (implementation + linux/ syscall)
* libc/test/src/sys/personality/ (unit tests)

Registered the entrypoint and header for x86_64, aarch64, riscv, and
arm. The implementation includes <linux/personality.h> for the
kernel-defined constants (PER_LINUX, ADDR_NO_RANDOMIZE, etc.) following
the same pattern as sys/prctl.h.
parent 45132b50
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -308,6 +308,9 @@ set(TARGET_LIBC_ENTRYPOINTS
    # sys/prctl.h entrypoints
    libc.src.sys.prctl.prctl

    # sys/personality.h entrypoints
    libc.src.sys.personality.personality

    # sys/auxv.h entrypoints
    libc.src.sys.auxv.getauxval

+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ set(TARGET_PUBLIC_HEADERS
    libc.include.sys_epoll
    libc.include.sys_ioctl
    libc.include.sys_mman
    libc.include.sys_personality
    libc.include.sys_prctl
    libc.include.sys_queue
    libc.include.sys_random
+3 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ set(TARGET_LIBC_ENTRYPOINTS
    # sys/prctl.h entrypoints
    libc.src.sys.prctl.prctl

    # sys/personality.h entrypoints
    libc.src.sys.personality.personality

    # sys/epoll.h entrypoints
    # Disabled due to epoll_wait syscalls not being available on this platform.
    # libc.src.sys.epoll.epoll_wait
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ set(TARGET_PUBLIC_HEADERS
    libc.include.wchar
    libc.include.wctype

    libc.include.sys_personality

    # Disabled due to epoll_wait syscalls not being available on this platform.
    # libc.include.sys_epoll
)
+3 −0
Original line number Diff line number Diff line
@@ -311,6 +311,9 @@ set(TARGET_LIBC_ENTRYPOINTS
    # sys/prctl.h entrypoints
    libc.src.sys.prctl.prctl

    # sys/personality.h entrypoints
    libc.src.sys.personality.personality

    # sys/auxv.h entrypoints
    libc.src.sys.auxv.getauxval

Loading