I was considering adding some custom security behaviour to the posix APIs of a distro of linux I'm working on.
For example, prompting the user to authenticate if a program asks to fopen() a directory it has write access to, but should not normally access.
Is there an easy way to hook custome behaviour in to a posix call before making the native linux call, or do I just have to branch my own source, and drop a function into the actual library before, performing the standard behaviour?