aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Marletta <angelo.marletta@gmail.com>2015-06-16 23:46:59 -0700
committerAngelo Marletta <angelo.marletta@gmail.com>2015-06-16 23:46:59 -0700
commitf4d2682804931e7aea02a869137344bb5452a3cd (patch)
tree09f4a38396fba6b306d3e1bda62509efa660b716
parentfd48ecf5a123ddaf5dd02d7928f975db719975bb (diff)
parent36394ead1f55c78526aa218bacad5e3cd7c5cc2c (diff)
downloadcpulimit-f4d2682804931e7aea02a869137344bb5452a3cd.tar.gz
Merge pull request #46 from dt1973/master
Fix build errors on FreeBSD
-rw-r--r--README.md (renamed from README)3
-rw-r--r--src/cpulimit.c4
-rw-r--r--tests/process_iterator_test.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/README b/README.md
index af00bf9..019579d 100644
--- a/README
+++ b/README.md
@@ -1,9 +1,6 @@
CPULIMIT
========
-About
------
-
Cpulimit is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time). It is useful to control batch jobs, when you don't want them to eat too many CPU cycles. The goal is prevent a process from running for more than a specified time ratio. It does not change the nice value or other scheduling priority settings, but the real CPU usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.
The control of the used CPU amount is done sending SIGSTOP and SIGCONT POSIX signals to processes.
All the children processes and threads of the specified process will share the same percentage of CPU.
diff --git a/src/cpulimit.c b/src/cpulimit.c
index dc61c3b..50eabea 100644
--- a/src/cpulimit.c
+++ b/src/cpulimit.c
@@ -43,6 +43,10 @@
#include <sys/types.h>
#include <sys/wait.h>
+#ifdef __APPLE__ || __FREEBSD__
+#include <libgen.h>
+#endif
+
#include "process_group.h"
#include "list.h"
diff --git a/tests/process_iterator_test.c b/tests/process_iterator_test.c
index 20ef479..1615196 100644
--- a/tests/process_iterator_test.c
+++ b/tests/process_iterator_test.c
@@ -28,7 +28,7 @@
#include <signal.h>
#include <string.h>
-#ifdef __APPLE__
+#ifdef __APPLE__ || __FREEBSD__
#include <libgen.h>
#endif
Un proyecto texto-plano.xyz