Temp root privilege in program?
Is it possible for a program (which is executed by a normal user) to obtain root privileges? How do you do it?
Basically I'm writing an app that needs to lock its allocated RAM. It's going to be filled way too fast to allow the kernel to swap the pages to harddrive. So I'm thinking of using the mlock() function to do that. But that requires that the program have root access.
I've had a look at setuid() but it seems like that only allows you to switch from root to a normal user. I need it to go the other way.
I could run the program with sudo, but I would prefer to just get temporary root access for the mlock() function.
Any advice welcome!