I would execute a mlockall
on a real-time process to lock the memory pages that does no have root privileges. Since the user ulimit
for max locked memory is really low (and it is ok due to security considerations), I would lock the memory via another process spawned by root
user.
Unfortunately, mlockall
has this signature:
int mlockall(int flags);
So, it works only if it is called directly by the target process. There exists a way (e.g. another syscall) to lock the memory of another process? Something like:
int mlockall(int flags, pid_t pid);