Entitlements cannot protect against things in your own process. They are always used to gate clients either across a kernel-user or XPC boundary.
Re:I Built an Ld_preload Worm
by jiveturkey on Tuesday April 30, 2024 @01:05PM
(#40213319)
isn't that exactly what the parent was asking for? limiting syscalls.
EDIT: oh. but not limited to the caller from a specific system library.
As to restricting syscalls from certain calling libraries, macOS has this via entitlements, and I believe OpenBSD and/or NetBSD has this in some form as well.