Submitted by: Ryan Bloom, Manoj Kasichainula
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83798
13f79535-47bb-0310-9956-
ffa450edef68
* INLINE will _not_ be set so we can use this to test if we are
* compiling this source file.
*/
+#include <unistd.h>
#ifndef INLINE
#define INLINE
{
return file[0] == '/';
}
+
+INLINE int ap_spawnvp(const char *file, char *const argv[])
+{
+ int pid;
+
+ if ((pid = fork()) == -1) {
+ return pid;
+ } else if (pid == 0) {
+ if (execvp(file, argv) == -1)
+ return -1;
+ else
+ return -1; /* If we get, we have a real error, but this keeps
+ us from getting a warning during compile time. */
+ } else
+ return pid;
+}
+
#define INLINE extern ap_inline
INLINE int ap_os_is_path_absolute(const char *file);
+/* spawn = fork + exec on unix */
+INLINE int ap_spawnvp(const char *file, char *const argv[]);
#include "os-inline.c"
* as normal
*/
extern int ap_os_is_path_absolute(const char *file);
+extern int ap_spawnvp(const char *file, char *const argv[]);
#endif
/* Other ap_os_ routines not used by this platform */