Remove qnx

This commit is contained in:
Robert Schulze 2023-02-14 22:10:22 +00:00
parent 1780bba532
commit cd7f6b7f0e
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
5 changed files with 0 additions and 67 deletions

View File

@ -27,8 +27,6 @@
# include "Poco/FPEnvironment_DEC.h"
#elif defined(sun) || defined(__sun)
# include "Poco/FPEnvironment_SUN.h"
#elif defined(__QNX__)
# include "Poco/FPEnvironment_QNX.h"
#elif defined(POCO_OS_FAMILY_UNIX)
# include "Poco/FPEnvironment_C99.h"
#elif defined(POCO_OS_FAMILY_WINDOWS)

View File

@ -86,9 +86,6 @@
#elif defined(sun) || defined(__sun)
# define POCO_OS_FAMILY_UNIX 1
# define POCO_OS POCO_OS_SOLARIS
#elif defined(__QNX__)
# define POCO_OS_FAMILY_UNIX 1
# define POCO_OS POCO_OS_QNX
#elif defined(unix) || defined(__unix) || defined(__unix__)
# define POCO_OS_FAMILY_UNIX 1
# define POCO_OS POCO_OS_UNKNOWN_UNIX

View File

@ -73,9 +73,6 @@
#if !defined(POCO_IOS_INIT_HACK)
// Microsoft Visual Studio with Dinkumware STL (but not STLport)
# if defined(__QNX__) && !defined(__GLIBCPP__)
# define POCO_IOS_INIT_HACK 1
# endif
#endif

View File

@ -23,8 +23,6 @@
#include "FPEnvironment_DEC.cpp"
#elif defined(sun) || defined(__sun)
#include "FPEnvironment_SUN.cpp"
#elif defined(__QNX__)
#include "FPEnvironment_QNX.cpp"
#elif defined(POCO_OS_FAMILY_UNIX)
#include "FPEnvironment_C99.cpp"
#elif defined(POCO_OS_FAMILY_WINDOWS)

View File

@ -25,11 +25,6 @@
#include <sys/wait.h>
#if defined(__QNX__)
#include <process.h>
#include <spawn.h>
#include <cstring>
#endif
namespace Poco {
@ -90,59 +85,7 @@ void ProcessImpl::timesImpl(long& userTime, long& kernelTime)
ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env)
{
#if defined(__QNX__)
if (initialDirectory.empty())
{
/// use QNX's spawn system call which is more efficient than fork/exec.
char** argv = new char*[args.size() + 2];
int i = 0;
argv[i++] = const_cast<char*>(command.c_str());
for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
argv[i++] = const_cast<char*>(it->c_str());
argv[i] = NULL;
struct inheritance inherit;
std::memset(&inherit, 0, sizeof(inherit));
inherit.flags = SPAWN_ALIGN_DEFAULT | SPAWN_CHECK_SCRIPT | SPAWN_SEARCH_PATH;
int fdmap[3];
fdmap[0] = inPipe ? inPipe->readHandle() : 0;
fdmap[1] = outPipe ? outPipe->writeHandle() : 1;
fdmap[2] = errPipe ? errPipe->writeHandle() : 2;
char** envPtr = 0;
std::vector<char> envChars;
std::vector<char*> envPtrs;
if (!env.empty())
{
envChars = getEnvironmentVariablesBuffer(env);
envPtrs.reserve(env.size() + 1);
char* p = &envChars[0];
while (*p)
{
envPtrs.push_back(p);
while (*p) ++p;
++p;
}
envPtrs.push_back(0);
envPtr = &envPtrs[0];
}
int pid = spawn(command.c_str(), 3, fdmap, &inherit, argv, envPtr);
delete [] argv;
if (pid == -1)
throw SystemException("cannot spawn", command);
if (inPipe) inPipe->close(Pipe::CLOSE_READ);
if (outPipe) outPipe->close(Pipe::CLOSE_WRITE);
if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
return new ProcessHandleImpl(pid);
}
else
{
return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env);
}
#else
return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env);
#endif
}