HI Allessandro,
I have used your suggestions as a guide and implemented the follow commit:
https://github.com/openscenegraph/OpenSceneGraph/commit/e49aaa9f2c4c82881394c4699eb3ee530dcaf35d
I tested the code under Linux by modifying it to force the use of
posix_spawn and found I had to add the #include <sys/wait.h>, I don't
know if this will break the Apple build. I have kept the logic for
selecting the feature simple by just testing for __APPLE__ right now.
If this works fine then there is no need to complicate things further.
Could test things out under OSX and iOS and let me know how you get on.
Cheers,
Robert.
The code now is:
#include <osg/os_utils>
extern "C" {
#define USE_POSIX_SPAWN defined(__APPLE__)
//#define USE_POSIX_SPAWN true
#if USE_POSIX_SPAWN
#include <spawn.h>
#include <sys/wait.h>
int osg_system(const char* command)
{
pid_t pid;
posix_spawn(&pid, command, NULL, NULL, NULL, NULL);
return waitpid(pid, NULL, 0);
}
#else // use tranditional C sysmtem call for osg_system implementation
int osg_system(const char* command)
{
return system(command);
}
#endif
}
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org