From 8efde826648b108d804ef99b57e58c7e0b6df507 Mon Sep 17 00:00:00 2001 From: dt1973 Date: Thu, 12 Mar 2015 08:37:29 +0100 Subject: Fix build errors on FreeBSD --- src/cpulimit.c | 4 ++++ tests/process_iterator_test.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 #include +#ifdef __APPLE__ || __FREEBSD__ +#include +#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 #include -#ifdef __APPLE__ +#ifdef __APPLE__ || __FREEBSD__ #include #endif -- cgit v1.2.3 From 36394ead1f55c78526aa218bacad5e3cd7c5cc2c Mon Sep 17 00:00:00 2001 From: dt1973 Date: Thu, 12 Mar 2015 08:38:06 +0100 Subject: Convert README to Markdown --- README | 45 --------------------------------------------- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 45 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index af00bf9..0000000 --- a/README +++ /dev/null @@ -1,45 +0,0 @@ -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. - -Developed by Angelo Marletta. -Please send your feedback, bug reports, feature requests or just thanks. - - -Get the latest source code --------------------------- - -The latest available code is here: - -https://github.com/opsengine/cpulimit - - -Install instructions --------------------- - -On Linux/OS X: - - $ make - # cp src/cpulimit /usr/bin - -On FreeBSD: - - $ gmake - # cp src/cpulimit /usr/bin - -Run unit tests: - - $ ./tests/process_iterator_test - - -Contributions -------------- - -You are welcome to contribute to cpulimit with bugfixes, new features, or support for a new OS. -If you want to submit a pull request, please do it on the branch develop and make sure all tests pass. diff --git a/README.md b/README.md new file mode 100644 index 0000000..019579d --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +CPULIMIT +======== + +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. + +Developed by Angelo Marletta. +Please send your feedback, bug reports, feature requests or just thanks. + + +Get the latest source code +-------------------------- + +The latest available code is here: + +https://github.com/opsengine/cpulimit + + +Install instructions +-------------------- + +On Linux/OS X: + + $ make + # cp src/cpulimit /usr/bin + +On FreeBSD: + + $ gmake + # cp src/cpulimit /usr/bin + +Run unit tests: + + $ ./tests/process_iterator_test + + +Contributions +------------- + +You are welcome to contribute to cpulimit with bugfixes, new features, or support for a new OS. +If you want to submit a pull request, please do it on the branch develop and make sure all tests pass. -- cgit v1.2.3