nix-shell: Restore CPU affinity
Otherwise the shell and its children will be bound to one CPU core...
This commit is contained in:
parent
0d38b4c792
commit
9fc4cb2ae9
1 changed files with 10 additions and 6 deletions
|
@ -1,18 +1,20 @@
|
|||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include "util.hh"
|
||||
#include <unistd.h>
|
||||
#include "shared.hh"
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "store-api.hh"
|
||||
#include "globals.hh"
|
||||
#include "derivations.hh"
|
||||
#include "affinity.hh"
|
||||
#include "util.hh"
|
||||
#include "shared.hh"
|
||||
|
||||
using namespace nix;
|
||||
using std::stringstream;
|
||||
|
||||
extern char ** environ;
|
||||
|
||||
|
@ -400,6 +402,8 @@ int main(int argc, char ** argv)
|
|||
for (const auto & env : drv.env)
|
||||
setenv(env.first.c_str(), env.second.c_str(), 1);
|
||||
|
||||
restoreAffinity();
|
||||
|
||||
// Run a shell using the derivation's environment. For
|
||||
// convenience, source $stdenv/setup to setup additional
|
||||
// environment variables and shell functions. Also don't lose
|
||||
|
|
Loading…
Reference in a new issue