osdSpawnve

osdSpawnve

osd

1998 12-05


NAME

osdSpawnve - spawn a process


SYNOPSIS

int osdSpawnve(char *path, char *argv[], char *env[])

osdSpawnve() creates a new process. The new process is created from the file whose name is specified by path.


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.


ARGUMENTS


path The file to be executed
argv The command line arguments
env The environment variables


EXAMPLES

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);