///
/// This method is used to convert arguments specified as an STL container
/// holding @c std::string objects to an array of C strings, used by the
- /// @c execvpe function in the @c ProcessSpawnImpl::spawn. It allocates a
+ /// @c execve function in the @c ProcessSpawnImpl::spawn. It allocates a
/// new C string and copies the contents of the @c src to it.
/// The data is stored in an internal container so that the caller of the
/// function can be exception safe.
// We're in the child process.
sigprocmask(SIG_SETMASK, &osset, 0);
// Run the executable.
- if (execvpe(executable_.c_str(), args_.get(), vars_.get()) != 0) {
- // We may end up here if the execvpe failed, e.g. as a result
+ if (execve(executable_.c_str(), args_.get(), vars_.get()) != 0) {
+ // We may end up here if the execve failed, e.g. as a result
// of issue with permissions or invalid executable name.
_exit(EXIT_FAILURE);
}
/// @brief Utility class for spawning new processes.
///
/// This class is used to spawn new process by Kea. It forks the current
-/// process and then uses the @c execvp function to execute the specified
+/// process and then uses the @c execve function to execute the specified
/// binary with parameters. The @c ProcessSpawn installs the handler for
/// the SIGCHLD signal, which is executed when the child process ends.
/// The handler checks the exit code returned by the process and records