#include "types.hh" #include "util.hh" #include "affinity.hh" #if HAVE_SCHED_H #include #endif namespace nix { #if HAVE_SCHED_SETAFFINITY static bool didSaveAffinity = false; static cpu_set_t savedAffinity; #endif void setAffinityTo(int cpu) { #if HAVE_SCHED_SETAFFINITY if (sched_getaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1) return; didSaveAffinity = true; printMsg(lvlDebug, format("locking this thread to CPU %1%") % cpu); cpu_set_t newAffinity; CPU_ZERO(&newAffinity); CPU_SET(cpu, &newAffinity); if (sched_setaffinity(0, sizeof(cpu_set_t), &newAffinity) == -1) printMsg(lvlError, format("failed to lock thread to CPU %1%") % cpu); #endif } int lockToCurrentCPU() { #if HAVE_SCHED_SETAFFINITY int cpu = sched_getcpu(); if (cpu != -1) setAffinityTo(cpu); return cpu; #else return -1; #endif } void restoreAffinity() { #if HAVE_SCHED_SETAFFINITY if (!didSaveAffinity) return; if (sched_setaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1) printMsg(lvlError, "failed to restore affinity %1%"); #endif } } href='/guix/'>summaryrefslogtreecommitdiff
path: root/gnu/packages/cryptsetup.scm
AgeCommit message (Expand)Author
2024-08-31gnu: cryptsetup: Only use ruby-asciidoctor on supported systems....* gnu/packages/cryptsetup.scm (cryptsetup)[native-inputs]: Only use ruby-asciidoctor on supported systems. [arguments]: When building without ruby-asciidoctor adjust the configure-flags. Change-Id: If4551833de3c5b5a28424c059644e9fa7fda5abd Efraim Flashner
2024-08-31gnu: cryptsetup: G-Expify static-library....* gnu/packages/cryptsetup.scm (static-library): G-Expify it. Change-Id: I3123cab24b08acdb5a28e0052e9a9663d00fd564 Josselin Poiret
2024-08-31gnu: cryptsetup-static: Fix static build....* gnu/packages/cryptsetup.scm (cryptsetup-static): Pass static variants of dependencies. Also work around wrong pkg-config paths of util-linux for the static output. Change-Id: I025f241b02ee0ea80227ef7d31789571e635ef2c Josselin Poiret
2024-08-31gnu: Add libcryptsetup-propagated-inputs....* gnu/packages/cryptsetup.scm (libcryptsetup-propagated-inputs): Record needed inputs for libcryptsetup. Change-Id: Ia630f2d5f180536d997af93e57aa547379b2c010 Josselin Poiret
2024-08-31gnu: cryptsetup: Update to 2.6.1....* gnu/packages/cryptsetup.scm (cryptsetup): Update to 2.6.1. Disable external tokens for now. Change-Id: I5610cabfbd46d010a8241430d8d90f5920847c04 Josselin Poiret
2023-12-23gnu: cryptsetup: Fix cross-compilation....* gnu/packages/cryptsetup.scm (cryptsetup): Set explicit `--with-libgcrypt-prefix' for cross-compilation. Change-Id: I39b8d07926865dd168f9db8d3eb84fafbf3f3c56 Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Leo Nikkilä