[Robelle] [SmugBook] [Index] [Prev] [Next]

Privileged Mode on MPE

Privileged mode or PM is a mode of program execution and a user capability that allows you to do almost anything you want to the system (MPE V had just two execution modes: User mode and Priv mode, but MPE/iX has several grades of power, called ring levels). PM is called superuser or root on UNIX.

While in Privileged mode, your program can look in system tables, modify main memory, and open privileged database files. Of course, it can also wipe out data that does not belong to you and cause system aborts. Only give PM capability to people you trust as much as the System Manager (on MPE, the System Manager can give himself PM capability anyway).

Programs can be either permanently PM or temporarily PM. Permanent PM is specified for a program thorough a compiler command such as $CONTROL PRIVILEGED or a language option such as OPTION PRIVILEGED. Temporary PM is attained by calling the GETPRIVMODE intrinsic and is given back with GETUSERMODE or by exiting from the current procedure.

Do not call GETUSERMODE in a library or utility routine to be used by many programs. If the caller happens to be in PM already, your exit will then cause a program abort.

Privileged File

An MPE file with a negative filecode is a privileged file. It cannot be opened except by a program that is running in Privileged mode. IMAGE/SQL databases, for example, are composed of privileged files.


[Robelle] [SmugBook] [Index] [Mpetips] [Prev] [Next]