VBoxService-os2.cpp revision 0f0fa99ce6af43d7a38d97fdecc89eae0bf89fdf
/** $Id$ */
/** @file
* VBoxService - Guest Additions Service Skeleton.
*/
/*
* Copyright (C) 2007 innotek GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/*******************************************************************************
* Global Variables *
*******************************************************************************/
#ifdef __OS2__
# define INCL_BASE
# define INCL_ERRORS
# include <os2.h>
#endif
#include <errno.h>
#include <VBox/VBoxGuest.h>
#include "VBoxServiceInternal.h"
/**
* OS/2 emulation of the BSD daemon() call.
*/
{
/* Get the full path to the executable. */
char szExe[CCHMAXPATH];
if (rc)
{
return -1;
}
/* calc the length of the command line. */
char *pchArgs;
{
while (*pch);
}
else
{
if (cch1)
else
}
/* spawn a detach process */
char szObj[128];
RESULTCODES ResCodes = { 0, 0 };
szObj[0] = '\0';
rc = DosExecPgm(szObj, sizeof(szObj), EXEC_BACKGROUND, (PCSZ)pchArgs, NULL, &ResCodes, (PCSZ)szExe);
if (rc)
{
return -1;
}
DosExit(EXIT_PROCESS, 0);
return -1;
}