summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-11-27 20:10:23 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-11-27 20:10:23 -0200
commitb4f6b110925a56d0818034ad1ecce8214ac873a0 (patch)
treecfd0de9013de6f50ce6bcab14592e44442f853e4 /linux/Platform.c
parent5578a316f047551d21f04a5df47fd705bf486ee3 (diff)
Move "get max pid" code into platform specific area.
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index ebd10331..4607ad68 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -93,3 +93,12 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
}
}
+int Platform_getMaxPid() {
+ FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
+ if (!file) return -1;
+ int maxPid = 4194303;
+ fscanf(file, "%32d", &maxPid);
+ fclose(file);
+ return maxPid;
+}
+