Skip to content

Commit

Permalink
Set PID_MAX based on actual value according to procfs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBuchanan314 committed Nov 19, 2019
1 parent 53b6143 commit 15b399c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: tardis novdso.so

tardis: tardis.c
gcc tardis.c -o tardis -lm -Wall -Ofast -std=c99
gcc tardis.c -o tardis -lm -Wall -Ofast -std=c99 -DPID_MAX=$(shell cat /proc/sys/kernel/pid_max)

novdso.so: novdso.c
gcc -std=c99 -Wall -fPIC -shared -o novdso.so novdso.c
2 changes: 2 additions & 0 deletions tardis.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#define MICROSECONDS 1000000
#define NANOSECONDS (MICROSECONDS*1000)
#define NUM_SYSCALLS 512 // this is higher than the real number, but shouldn't matter
#ifndef PID_MAX
#define PID_MAX 32768 // XXX: assumption
#endif
#define NUM_CLKIDS 16 // XXX: incorrect, but "works" anyway

double starttimes[NUM_CLKIDS], delayfactor, timefactor;
Expand Down

0 comments on commit 15b399c

Please sign in to comment.