PtSpawnWait()

Spawn a process and wait for its termination

Synopsis:

int PtSpawnWait( const char *cmd,
                 const char **argv,
                 const char **env,
                 const PtSpawnOptions_t *opt,
                 pid_t *pidp );

Library:

ph

Description:

This function spawns a new process and waits for its termination. While the child process is running, Photon events are processed.

If pidp isn't NULL, the process ID of the spawned command is stored in *pidp. This can be used if callback functions need to communicate with the running child process.

The meaning of all the other arguments is the same as for the PtSpawn() function.

Returns:

The termination status of the child (see waitpid()), or -1 if the child process couldn't be started.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtSpawn(), PtSpawnSetCallback(), PtSpawnDeleteCallback()