How to block the memory of an unprivileged user?

I need to lock the pages of my program in memory. The program runs under Solaris 10 from an unprivileged user. I tried using: mlock (), mlockall () and plock (), but always get the same result:

plock / mlock / mlockall: Not owner

But it works as root. Can I block the pages of my program in memory from an unprivileged user, somehow?

Thank!

+5
source share
1 answer

I have found a solution and want to share it. Maybe it will be useful for someone else. I changed the user privileges, in Solaris this can be done with the following command:

usermod -K defaultpriv=basic,proc_lock_memory user

, Linux , Linux.

+5

All Articles