process.h revision 1ed919e3ed826d6de4ec379bbc1b333624055939
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * IPRT - Process Management.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Copyright (C) 2006-2007 Sun Microsystems, Inc.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * This file is part of VirtualBox Open Source Edition (OSE), as
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * available from http://www.virtualbox.org. This file is free software;
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * you can redistribute it and/or modify it under the terms of the GNU
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * General Public License (GPL) as published by the Free Software
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Foundation, in version 2 as it comes in the "COPYING" file of the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * The contents of this file may alternatively be used under the terms
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * of the Common Development and Distribution License Version 1.0
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * VirtualBox OSE distribution, in which case the provisions of the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * CDDL are applicable instead of those of the GPL.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * You may elect to license modified versions of this file under the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * terms and conditions of either the GPL or the CDDL or both.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Clara, CA 95054 USA or visit http://www.sun.com if you need
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * additional information or have any questions.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey/** @defgroup grp_rt_process RTProc - Process Management
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * @ingroup grp_rt
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Process priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * The process priority is used to select how scheduling properties
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * are assigned to the different thread types (see THREADTYPE).
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * In addition to using the policy assigned to the process at startup (DEFAULT)
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * it is possible to change the process priority at runtime. This allows for
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * a GUI, resource manager or admin to adjust the general priority of a task
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * without upsetting the fine-tuned priority of the threads within.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Invalid priority. */
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Default priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Derive the scheduling policy from the priority of the RTR3Init()
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * and RTProcSetPriority() callers and the rights the process have
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * to alter its own priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Flat priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Assumes a scheduling policy which puts the process at the default priority
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * and with all thread at the same priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Low priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Assumes a scheduling policy which puts the process mostly below the
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * default priority of the host OS.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Normal priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Assume a scheduling policy which shares the CPU resources fairly with
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * other processes running with the default priority of the host OS.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** High priority.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Assumes a scheduling policy which puts the task above the default
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * priority of the host OS. This policy might easily cause other tasks
38f140aaa4a32508dc5318744dd8d51ab84b23a5Michael Hunter * in the system to starve.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey /** Last priority, used for validation. */
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Get the current process identifier.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * @returns Process identifier.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * Get the current process handle.
6ba597c56d749c61b4f783157f63196d7b2445f0Anurag S. Maskey * @returns Ring-0 process handle.
#ifdef IN_RING3
* @param papszArgs Pointer to an array of arguments to the child. The array terminated by an entry containing NULL.
RTR3DECL(int) RTProcCreate(const char *pszExec, const char * const *papszArgs, RTENV Env, unsigned fFlags, PRTPROCESS pProcess);
* @remarks The as-user feature isn't supported/implemented on all platforms and
RTR3DECL(int) RTProcCreateEx(const char *pszExec, const char * const *papszArgs, RTENV hEnv, uint32_t fFlags,
typedef enum RTPROCEXITREASON
typedef struct RTPROCSTATUS
int iStatus;
} RTPROCSTATUS;
#define RTPROCWAIT_FLAGS_BLOCK 0