diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/integrity.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/integrity.c b/src/server/integrity.c index 82d493e..beec81d 100644 --- a/src/server/integrity.c +++ b/src/server/integrity.c @@ -11,8 +11,10 @@ #include <fcntl.h> #include <stdio.h> #include <unistd.h> +#include <sys/syscall.h> #include <string.h> #include <assert.h> +#include <sys/resource.h> #define CHECK_QUEUE_SIZE 100 @@ -101,6 +103,11 @@ static void* integrity_main(void *data) uint8_t *buffer = NULL; size_t bufferSize = 0; setThreadName( "image-check" ); +#if defined(linux) || defined(__linux) + // Setting nice of this thread - this is not POSIX conforming, so check if other platforms support this + pid_t tid = syscall( SYS_gettid ); + setpriority( PRIO_PROCESS, tid, 10 ); +#endif pthread_mutex_lock( &integrityQueueLock ); while ( !_shutdown ) { for (i = queueLen - 1; i >= 0; --i) { |