Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 QNX Help
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tallguy




PostPosted: Wed Feb 06, 2013 4:08 pm   Post subject: QNX Help

Greetings, Within QNX how would you run another code executable? I was thinking of spawn(), the other file is within my same project,

code:

#include <spawn.h>


int main(void) {
        struct inheritance inherit;
        char *args[3];
        pid_t pid;

        inherit.flags = 0;
        inherit.pgroup = 0;
        inherit.runmask = 0xffffffff;

        args[0] = "-x0";
        args[1] = "-y0";
        args[2] = NULL;

        pid = spawn("/x86/o/operator.o", 0, NULL, &inherit, args, NULL);
return (0);
}


BUT where does QNX save the executables? so that i can run them? :/
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: Sun Feb 10, 2013 3:09 am   Post subject: Re: QNX Help

Look to fork and exec

http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/lib_ref/f/fork.html

Strings passed to execvp can be of the form "./program" which will force looking in current working dir (for instance - any slash in the name and it's a fixed path), otherwise the system will search through PATH.

Cheers

p.s. Just looked. The QNX spawn family looks pretty handy, but may be less portable. Or I'm old, and resistant to new fangled progress.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: