def get_running_process(cpu_index = 0): """Returns the PGD or address space of the process that is being executed at this moment :param cpu_index: CPU index that we want to query. Each CPU might be executing a different address space :type cpu_index: int :return: The PGD or address space for the process that is executing on the indicated CPU :rtype: int """ import c_api #If this function call fails, it will raise an exception. #Given that the exception is self explanatory, we just let it propagate upwards return c_api.get_running_process(cpu_index)
def get_running_process(cpu_index=0): """Returns the PGD or address space of the process that is being executed at this moment :param cpu_index: CPU index that we want to query. Each CPU might be executing a different address space :type cpu_index: int :return: The PGD or address space for the process that is executing on the indicated CPU :rtype: int """ import c_api # If this function call fails, it will raise an exception. # Given that the exception is self explanatory, we just let it propagate # upwards if cpu_index >= get_num_cpus(): raise ValueError("Incorrect cpu index specified") return c_api.get_running_process(cpu_index)