Skip to content

Commit

Permalink
Merge pull request #46 from dt1973/master
Browse files Browse the repository at this point in the history
Fix build errors on FreeBSD
  • Loading branch information
opsengine committed Jun 17, 2015
2 parents fd48ecf + 36394ea commit f4d2682
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/cpulimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tests/process_iterator_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <signal.h>
#include <string.h>

#ifdef __APPLE__
#ifdef __APPLE__ || __FREEBSD__
#include <libgen.h>
#endif

Expand Down

0 comments on commit f4d2682

Please sign in to comment.