Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
child_process_windows.cc File Reference
#include <windows.h>
#include <chrono>
#include <optional>
#include <string>
#include <vector>
#include "core/child_process.h"
Include dependency graph for child_process_windows.cc:

Namespaces

namespace  mm
 
namespace  mm::core
 

Functions

std::expected< Child, std::string > mm::core::spawnChild (const std::filesystem::path &binary, const std::vector< std::string > &args, const std::filesystem::path &logFile)
 Runs binary with args, with its output appended to logFile.
 
bool mm::core::childAlive (const Child &child)
 Whether child is still running.
 
std::optional< int > mm::core::waitChild (const Child &child, std::chrono::milliseconds timeout)
 Waits up to timeout for child to exit, and reaps it.
 
bool mm::core::terminateChild (const Child &child, std::chrono::milliseconds grace)
 Asks child to exit, waits up to grace, then kills it and everything it started.