process-posix.cpp revision 64eea8161bef2aa3c6516481383c830bca27abfe
/* $Id$ */
/** @file
* IPRT - Process, POSIX.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <pwd.h>
{
int rc;
while (rc == VERR_INTERRUPTED);
return rc;
}
{
/*
* Validate input.
*/
if (Process <= 0)
{
return VERR_INVALID_PARAMETER;
}
{
return VERR_INVALID_PARAMETER;
}
/*
* Perform the wait.
*/
int iStatus = 0;
if (rc > 0)
{
/*
* Fill in the status structure.
*/
if (pProcStatus)
{
{
}
else if (WIFSIGNALED(iStatus))
{
}
else
{
}
}
return VINF_SUCCESS;
}
/*
* Child running?
*/
if (!rc)
{
return VERR_PROCESS_RUNNING;
}
/*
* Figure out which error to return.
*/
return VERR_PROCESS_NOT_FOUND;
return RTErrConvertFromErrno(iErr);
}
{
if (Process == NIL_RTPROCESS)
return VINF_SUCCESS;
return VINF_SUCCESS;
return RTErrConvertFromErrno(errno);
}
{
/// @todo
return 1;
}
{
if (hProcess != RTProcSelf())
return VERR_NOT_SUPPORTED;
if (cbPwdMax == -1)
return RTErrConvertFromErrno(errno);
if (!pbBuf)
return VERR_NO_MEMORY;
if (!rc)
{
if (pcbUser)
else
{
rc = VINF_SUCCESS;
}
}
else
return rc;
}