mirror of
https://github.com/uselessd/alcove.git
synced 2026-04-15 09:15:19 +00:00
Interface to prctl(2) so that seccomp mode can eventually be added. Supporting prctl is tricky. prctl(2) has 5 arguments: an option that sets the operation and 4 arg whose type and use is dependent on the operation. Usually only the second argument is used. The type of the second argument can be: * an unsigned long (the declared type) * a pointer to char * a pointer to int Since a long will match the size of a pointer, this works. However, passing in a integer when a pointer is expected may crash the process. The return value is either the function result or written into the pointed value, depending on the operation. alcove uses an int (4 bytes) to represent the unsigned long. This may overflow on 64-bit platforms (will be fixed!).