Skip to content

Commit f4d2682

Browse files
committed
Merge pull request #46 from dt1973/master
Fix build errors on FreeBSD
2 parents fd48ecf + 36394ea commit f4d2682

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

README renamed to README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
CPULIMIT
22
========
33

4-
About
5-
-----
6-
74
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.
85
The control of the used CPU amount is done sending SIGSTOP and SIGCONT POSIX signals to processes.
96
All the children processes and threads of the specified process will share the same percentage of CPU.

src/cpulimit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
#include <sys/types.h>
4444
#include <sys/wait.h>
4545

46+
#ifdef __APPLE__ || __FREEBSD__
47+
#include <libgen.h>
48+
#endif
49+
4650
#include "process_group.h"
4751
#include "list.h"
4852

tests/process_iterator_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <signal.h>
2929
#include <string.h>
3030

31-
#ifdef __APPLE__
31+
#ifdef __APPLE__ || __FREEBSD__
3232
#include <libgen.h>
3333
#endif
3434

0 commit comments

Comments
 (0)