mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Initial runProgram implementation for Windows
This is incomplete; proper shell escaping needs to be done
This commit is contained in:
parent
e0b4691754
commit
a58ca342ca
2 changed files with 331 additions and 8 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "types.hh"
|
||||
#include "error.hh"
|
||||
#include "file-descriptor.hh"
|
||||
#include "logging.hh"
|
||||
#include "ansicolor.hh"
|
||||
|
||||
|
@ -23,26 +24,36 @@ namespace nix {
|
|||
struct Sink;
|
||||
struct Source;
|
||||
|
||||
#ifndef _WIN32
|
||||
class Pid
|
||||
{
|
||||
#ifndef _WIN32
|
||||
pid_t pid = -1;
|
||||
bool separatePG = false;
|
||||
int killSignal = SIGKILL;
|
||||
#else
|
||||
AutoCloseFD pid = INVALID_DESCRIPTOR;
|
||||
#endif
|
||||
public:
|
||||
Pid();
|
||||
#ifndef _WIN32
|
||||
Pid(pid_t pid);
|
||||
~Pid();
|
||||
void operator =(pid_t pid);
|
||||
operator pid_t();
|
||||
#else
|
||||
Pid(AutoCloseFD pid);
|
||||
void operator =(AutoCloseFD pid);
|
||||
#endif
|
||||
~Pid();
|
||||
int kill();
|
||||
int wait();
|
||||
|
||||
// TODO: Implement for Windows
|
||||
#ifndef _WIN32
|
||||
void setSeparatePG(bool separatePG);
|
||||
void setKillSignal(int signal);
|
||||
pid_t release();
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue