blob: 5f1f7460fa53e7f912d0119b0adf80c1a3103f1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
diff -r -U4 cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/cpulimit.c cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/cpulimit.c
--- cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/cpulimit.c 2015-06-17 08:46:59.000000000 +0200
+++ cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/cpulimit.c 2020-11-23 16:48:41.094970897 +0100
@@ -25,8 +25,11 @@
*
* Get the latest version at: http://github.com/opsengine/cpulimit
*
*/
+#ifdef __linux__
+#define _GNU_SOURCE
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -37,14 +40,19 @@
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <sys/sysctl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
-#ifdef __APPLE__ || __FREEBSD__
+#ifdef __linux__
+#include <linux/sysctl.h>
+#else
+#include <sys/sysctl.h>
+#endif
+
+#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
#include <libgen.h>
#endif
#include "process_group.h"
diff -r -U4 cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/process_group.c cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/process_group.c
--- cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/process_group.c 2015-06-17 08:46:59.000000000 +0200
+++ cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/process_group.c 2020-11-23 16:45:41.423515953 +0100
@@ -24,8 +24,12 @@
#include <limits.h>
#include <sys/time.h>
#include <signal.h>
+#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
+#include <libgen.h>
+#endif
+
#include <assert.h>
#include "process_iterator.h"
#include "process_group.h"
diff -r -U4 cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/tests/process_iterator_test.c cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/tests/process_iterator_test.c
--- cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/tests/process_iterator_test.c 2015-06-17 08:46:59.000000000 +0200
+++ cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/tests/process_iterator_test.c 2020-11-23 16:44:38.051362981 +0100
@@ -27,9 +27,9 @@
#include <time.h>
#include <signal.h>
#include <string.h>
-#ifdef __APPLE__ || __FREEBSD__
+#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
#include <libgen.h>
#endif
#include <process_iterator.h>
|