ussd84
ussd84

Reputation: 99

Loading a unix executable file within ios app

I have a unix executable file that I need to run when the application is launched. Basically the file is a server using xml-rpc to communicate with the client. Does iOS allow execution of such files? This app is not going to be submitted to the app store so I'm not worried about that. I'm merely setting this up as a small testing project. I've tried posix_spawn but a simple ls command returns the error "Bad address." I tried this command with path to my file but got similar error.

char argv[] = {"/bin/sh", "-c", "ls", NULL};

int status = posix_spawn(&pid, argv[0], NULL, NULL, argv, environ);

if (status == 0) {
    printf("Child pid: %i\n", pid);
} else {
    printf("posix_spawn: %s\n", strerror(status));
}

Upvotes: 1

Views: 729

Answers (1)

Gordon Childs
Gordon Childs

Reputation: 36084

iOS doesn't allow you to spawn new processes.

Upvotes: 2

Related Questions