diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/exec/spawnv.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/crt32/exec/spawnv.c')
-rw-r--r-- | private/crt32/exec/spawnv.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/private/crt32/exec/spawnv.c b/private/crt32/exec/spawnv.c new file mode 100644 index 000000000..fe90c213f --- /dev/null +++ b/private/crt32/exec/spawnv.c @@ -0,0 +1,67 @@ +/*** +*spawnv.c - spawn a child process +* +* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _spawnv() - spawn a child process +* +*Revision History: +* 04-15-84 DFW written +* 12-11-87 JCR Added "_LOAD_DS" to declaration +* 11-20-89 GJF Fixed copyright, alignment. Added const to arg types +* for pathname and argv. +* 03-08-90 GJF Replace _LOAD_DS with _CALLTYPE1 and added #include +* <cruntime.h>. +* 07-24-90 SBM Removed redundant includes, replaced <assertm.h> by +* <assert.h> +* 09-27-90 GJF New-style function declarator. +* 01-17-91 GJF ANSI naming. +* 02-14-90 SRW Use NULL instead of _environ to get default. +* +*******************************************************************************/ + +#include <cruntime.h> +#include <assert.h> +#include <stdlib.h> +#include <process.h> + +/*** +*int _spawnv(modeflag, pathname, argv) - spawn a child process +* +*Purpose: +* Spawns a child process. +* formats the parameters and calls _spawnve to do the actual work. The +* NULL environment pointer indicates that the new process will inherit +* the parents process's environment. NOTE - at least one argument must +* be present. This argument is always, by convention, the name of the +* file being spawned. +* +*Entry: +* int modeflag - mode to spawn (WAIT, NOWAIT, or OVERLAY) +* only WAIT and OVERLAY currently implemented +* char *pathname - file to spawn +* char **argv - vector of arguments +* +*Exit: +* returns exit code of child process +* if fails, returns -1 +* +*Exceptions: +* +*******************************************************************************/ + +int _CALLTYPE1 _spawnv ( + int modeflag, + const char *pathname, + const char * const *argv + ) +{ + assert(pathname != NULL); + assert(*pathname != '\0'); + assert(argv != NULL); + assert(*argv != NULL); + assert(**argv != '\0'); + + return(_spawnve(modeflag,pathname,argv,NULL)); +} |