change exec and spawn to _exec and _spawn
authorBoudewijn Dekker <ariadne@xs4all.nl>
Sun, 21 Feb 1999 13:43:05 +0000 (13:43 +0000)
committerBoudewijn Dekker <ariadne@xs4all.nl>
Sun, 21 Feb 1999 13:43:05 +0000 (13:43 +0000)
svn path=/trunk/; revision=262

17 files changed:
reactos/lib/crtdll/process/System.c
reactos/lib/crtdll/process/execl.c
reactos/lib/crtdll/process/execle.c
reactos/lib/crtdll/process/execlp.c
reactos/lib/crtdll/process/execlpe.c
reactos/lib/crtdll/process/execv.c
reactos/lib/crtdll/process/execve.c
reactos/lib/crtdll/process/execvp.c
reactos/lib/crtdll/process/execvpe.c
reactos/lib/crtdll/process/spawnl.c
reactos/lib/crtdll/process/spawnle.c
reactos/lib/crtdll/process/spawnlp.c
reactos/lib/crtdll/process/spawnlpe.c
reactos/lib/crtdll/process/spawnv.c
reactos/lib/crtdll/process/spawnve.c
reactos/lib/crtdll/process/spawnvp.c
reactos/lib/crtdll/process/spawnvpe.c

index 861f3ca..fcaadb4 100644 (file)
@@ -1,7 +1,7 @@
 #include <process.h>
 #include <windows.h>
 
-int system(const char *command)
+int _system(const char *command)
 {
        char CmdLine[MAX_PATH];
        char *comspec = getenv("COMSPEC");
@@ -13,4 +13,4 @@ int system(const char *command)
                return -1;
 
        return 0;
-}
\ No newline at end of file
+}
index f971024..1e19184 100644 (file)
@@ -4,7 +4,7 @@
 
 extern char *const *_environ;
 
-int execl(const char *path, const char *argv0, ...)
+int _execl(const char *path, const char *argv0, ...)
 {
-  return spawnve(P_OVERLAY, path, (char *const*)&argv0, _environ);
+  return _spawnve(P_OVERLAY, path, (const char *const*)&argv0,(const char *const*) _environ);
 }
index c68ec0f..3d7c3b3 100644 (file)
@@ -10,8 +10,8 @@
        u.ccp = *++ptr; \
        ptr = u.ccpp;
 
-int execle(const char *path, const char *argv0, ... /*, const char **envp */)
+int _execle(const char *path, const char *argv0, ... /*, const char **envp */)
 {
   scan_ptr();
-  return spawnve(P_OVERLAY, path, (char *const *)&argv0, (char *const *)ptr);
+  return _spawnve(P_OVERLAY, path, (const char *const *)&argv0, (const char *const *)ptr);
 }
index 45c1192..ab9cbe3 100644 (file)
@@ -3,9 +3,9 @@
 #include <process.h>
 
 
-extern char * const *_environ;
+extern char **_environ;
 
-int execlp(const char *path, const char *argv0, ...)
+int _execlp(const char *path, const char *argv0, ...)
 {
-  return spawnvpe(P_OVERLAY, path, (char * const *)&argv0, _environ);
+  return _spawnvpe(P_OVERLAY, path, (const char * const *)&argv0,(const char *const*) _environ);
 }
index da5f708..9afa113 100644 (file)
@@ -10,8 +10,8 @@
        u.ccp = *++ptr; \
        ptr = u.ccpp;
 
-int execlpe(const char *path, const char *argv0, ... /*, const char **envp */)
+int _execlpe(const char *path, const char *argv0, ... /*, const char **envp */)
 {
   scan_ptr();
-  return spawnvpe(P_OVERLAY, path, (char * const *)&argv0, (char * const *)ptr);
+  return _spawnvpe(P_OVERLAY, path, (const char * const *)&argv0, (const char * const *)ptr);
 }
index 893cf85..20a525e 100644 (file)
@@ -1,11 +1,10 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-//#include <unistd.h>
+
 #include <process.h>
 
 extern char * const *_environ;
 
-int execv(const char *path, const char * const *argv)
+int _execv(const char *path, const char * const *argv)
 {
-  return spawnve(P_OVERLAY, path, argv, _environ);
+  return _spawnve(P_OVERLAY, path, argv,(const char *const*) _environ);
 }
index 38b4a96..2bc3ca8 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-//#include <unistd.h>
+
 #include <process.h>
 
-int execve(const char *path,const  char * const argv[], char * const envp[])
+int _execve(const char *path,const  char * const argv[], char * const envp[])
 {
-  return spawnve(P_OVERLAY, path, argv, envp);
+  return _spawnve(P_OVERLAY, path, argv, envp);
 }
index cdaad87..6b5f308 100644 (file)
@@ -1,11 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-//#include <unistd.h>
 #include <process.h>
 
 extern char *const *_environ;
 
-int execvp(const char *path,const char * const argv[])
+int _execvp(const char *path,const char * const argv[])
 {
-  return spawnvpe(P_OVERLAY, path, argv, _environ);
+  return _spawnvpe(P_OVERLAY,path,(const char *const*) argv,(const char *const*) _environ);
 }
index d4af43e..4d1a4c2 100644 (file)
@@ -3,13 +3,10 @@
 
 #include <process.h>
 
-int execvpe(const char *path,const char * const argv[],const char * const envp[])
+int _execvpe(const char *path,const char * const argv[],const char * const envp[])
 {
-  return spawnvpe(P_OVERLAY, path, argv, envp);
+  return _spawnvpe(P_OVERLAY, path, argv, envp);
 }
 
 
-int _execvpe(const char *path,const char * const argv[],const char * const envp[])
-{
-  return spawnvpe(P_OVERLAY, path, argv, envp);
-}
\ No newline at end of file
+
index 0397fb9..a706a87 100644 (file)
@@ -2,9 +2,9 @@
 
 #include <process.h>
 
-extern char **_environ;
+extern char *_environ[];
 
-int spawnl(int mode, const char *path, const char *argv0, ...)
+int _spawnl(int mode, const char *path, const char *argv0, ...)
 {
-  return spawnve(mode, path, (char * const *)&argv0, _environ);
+  return _spawnve(mode, path, (const char * const *)&argv0,(const char *const *) _environ);
 }
index 157caad..cf14aa5 100644 (file)
@@ -9,8 +9,8 @@
        u.ccp = *++ptr; \
        ptr = u.ccpp;
 
-int spawnle(int mode, const char *path, const char *argv0, ... /*, const char **envp */)
+int _spawnle(int mode, const char *path, const char *argv0, ... /*, const char **envp */)
 {
   scan_ptr();
-  return spawnve(mode, path, (char * const *)&argv0, (char * const *)ptr);
+  return _spawnve(mode, path, (const char * const *)&argv0, (const char * const *)ptr);
 }
index 8813e5c..4d1a110 100644 (file)
@@ -4,7 +4,7 @@
 
 extern char **_environ;
 
-int spawnlp(int mode, const char *path, const char *argv0, ...)
+int _spawnlp(int mode, const char *path, const char *argv0, ...)
 {
-  return spawnvpe(mode, path, (char * const *)&argv0, (char * const *)_environ);
+  return _spawnvpe(mode, path, (const char * const *)&argv0, (const char * const *)_environ);
 }
index 908e2f4..38558a4 100644 (file)
@@ -11,5 +11,5 @@
 int spawnlpe(int mode, const char *path, const char *argv0, ... /*, const char **envp */)
 {
   scan_ptr();
-  return spawnvpe(mode, path, (char * const *)&argv0, (char * const *)ptr);
+  return spawnvpe(mode, path, (const char * const *)&argv0, (const char * const *)ptr);
 }
index a41b777..edc135a 100644 (file)
@@ -2,9 +2,9 @@
 
 #include <process.h>
 
-extern char **_environ;
+extern char *_environ[];
 
-int spawnv(int mode, const char *path,const char *const argv[])
+int _spawnv(int mode, const char *path,const char *const argv[])
 {
-  return spawnve(mode, path, (char * const *)argv, _environ);
+  return _spawnve(mode, path, (const char * const *)argv,(const char * const *) _environ);
 }
index c848475..3d21e7b 100644 (file)
@@ -1,11 +1,12 @@
+#include <windows.h>
 #include <process.h>
 #include <string.h>
-#include <windows.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 int _p_overlay = 2;
 
-int spawnve(int mode, const char *path,const char *const argv[],const char *const envp[])
+int _spawnve(int mode, const char *path,const char *const argv[],const char *const envp[])
 {
 
   char ApplicationName[MAX_PATH];
@@ -28,15 +29,15 @@ int spawnve(int mode, const char *path,const char *const argv[],const char *cons
   StartupInfo.dwFlags = 0;
 
 
-//  if ( CreateProcessA(ApplicationName,CommandLine,NULL,NULL,TRUE,CREATE_NEW_CONSOLE|NORMAL_PRIORITY_CLASS,NULL,*envp,&StartupInfo,&ProcessInformation) ) {
-//     errno = GetLastError();
-//     return -1;
-//  }
+  if ( CreateProcessA(ApplicationName,CommandLine,NULL,NULL,TRUE,CREATE_NEW_CONSOLE|NORMAL_PRIORITY_CLASS,NULL,*envp,&StartupInfo,&ProcessInformation) ) {
+       //errno = GetLastError();
+       return -1;
+  }
 
   
   if (mode == P_OVERLAY)
     exit(i);
 
 // _P_NOWAIT or _P_NOWAITO 
-  return ProcessInformation.hProcess;
+  return (int)ProcessInformation.hProcess;
 }
index 34b39cc..5757a50 100644 (file)
@@ -2,9 +2,9 @@
 
 #include <process.h>
 
-extern char **_environ;
+extern char *_environ[];
 
-int spawnvp(int mode, const char *path,const char *const argv[])
+int _spawnvp(int mode, const char *path,const char *const argv[])
 {
-  return spawnvpe(mode, path, (char * const *)argv, _environ);
+  return _spawnvpe(mode, path, (const char * const *)argv,(const char * const *) _environ);
 }
index 4ba9a2e..b580de6 100644 (file)
@@ -4,20 +4,10 @@
 #include <errno.h>
 
 
-int spawnvpe(int mode, const char *path,const char *const argv[],const char *const envp[])
+int _spawnvpe(int mode, const char *path,const char *const argv[],const char *const envp[])
 {
-
-  char rpath[300];
-  union {const char * const *cpcp; char **cpp; } u;
-  u.cpcp = envp;
-/*
-  if (!__dosexec_find_on_path(path, u.cpp, rpath))
-  {
-    errno = ENOENT;
-    return -1;
-  }
-  else
-*/
-    return spawnve(mode, rpath, argv, envp);
+// djgpp does something like a searchpath here
+    return _spawnve(mode, path, argv, envp);
 
 }