1 /**[txh]********************************************************************
3 Module: Spawn replacement for UNIXes
5 This module provides spawnv and spawnvp functions for UNIX.@*
6 Copyright 1999 by Salvador E. Tropea. You can use it under the terms of
7 the GPL license. e-mail: salvador@inti.gov.ar, set@computer.org
11 ***************************************************************************/
20 /**[txh]********************************************************************
23 That's a replacement for the DOS spawnv function which was POSIX during
24 the drafts but then was removed. It avoids the need of the fork/exec/wait
25 sequence which doesn't work for djgpp.
27 ***************************************************************************/
30 spawnv (int mode, const char *path, char *const argv[])
34 if (mode == P_OVERLAY)
35 return execv (path, argv);
38 if (execv (path, argv))
46 /**[txh]********************************************************************
49 Same as spawnv but using execvp. @x{spawnv}.
51 ***************************************************************************/
54 spawnvp (int mode, const char *path, char *const argv[])
58 if (mode == P_OVERLAY)
59 return execv (path, argv);
62 if (execvp (path, argv))