int osdSpawnve(char *path, char *argv[], char *env[])
The argument argv
is a pointer to a null-terminated array of character pointers to
null-terminated character strings. argv
is the command line argument list for the new process. The first element
(argv[0]) should be the name of the executed program.
argv may be NULL.
The argument env
is a pointer to a null-terminated array of character pointers to
null-terminated character strings. env
is a list of environment variables. env
may be NULL, in which case no extra environment variables are passed to the
new process.
On failure osdSpawnve() returns -1, otherwise osdSpawnve returns the process
id of the new process.
| path | The file to be executed |
| argv | The command line arguments |
| env | The environment variables |
char *arg[2]; char string[10]; arg[0] = argv[0]; arg[1] = string; sprintf(arg[1],"child_arg"); arg[2] = NULL; osdSpawnve(argv[0],arg,NULL);