QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Moving the program from root directory generates mmap errors in QNX4 |
Ref. No. |
QNX.000001634 |
Category(ies) |
Development |
Issue |
We have a program in QNX4 that is including mmap() for Physical memory mapping. The program runs fine under the "root" directory. However, if the program moves to another directory, say /home/p35, the program stops working because mmap() fails on the memory mapping. The /home/p35 is not login from "root". Does Physical memory map function mmap() have to run under "root" ?
|
Solution |
Only root can access phyical memory to map it, not a user. This is because to do any low level accessing you have to be root. This is to prevent malicious or careless users from having the ability to severely alter or crash the system. All drivers, etc. run as root. Since it would be a security issue for a non-root program to make itself root, the only thing you can do is as root chmod u+s <app> which will let anyone run it as root. |
|