1. A method for executing privileged code in a process, the method comprising: establishing, by an authorized library, a privileged function, the privileged function having a first privilege level used by a processor that is executing the privileged function, while preserving a different privilege level for a process invoking the privileged function; communicating, to a computer process, access information of the privileged function, to allow the computer process to invoke the privileged function; and executing the privileged function for the computer process, including setting a processor that is being used by the computer process to use the first privilege level associated with the privileged function, executing the privileged function with that processor at the first privilege level, then restoring that processor to a previous privilege level, and returning control of that processor to the computer process.