DavidBuchanan314 / TARDIS

Trace And Rewrite Delays In Syscalls: Hooking time-related Linux syscalls to warp a process's perspective of time, using ptrace.
MIT License
156 stars 14 forks source link

sys_pkey_free undeclared #1

Closed kidd closed 7 years ago

kidd commented 7 years ago

Hi, I'm trying to compile the project (which looks super fun and educative, btw), and I'm getting

tardis.c:19:22: error: ‘SYS_pkey_free’ undeclared here (not in a function)
 #define NUM_SYSCALLS SYS_pkey_free+1 // XXX: may change in future
                      ^
tardis.c:25:24: note: in expansion of macro ‘NUM_SYSCALLS’
 void (*before_handlers[NUM_SYSCALLS])(pid_t, struct user_regs_struct *);
                        ^
Makefile:4: recipe for target 'tardis' failed
make: *** [tardis] Error 1

I guess from http://lxr.free-electrons.com/ident?v=4.9;i=sys_pkey_free that I need a kernel 4.9 at least to use it. If this is the case, could you add it to the readme? thx!

DavidBuchanan314 commented 7 years ago

Actually, I was only using that value to represent "the highest possible syscall" for the syscall handler lookup table. I have replaced it with a hardcoded value of 512, which should work fine until some future kernel which may have more than 512 syscalls!

However, my use of PTRACE_SEIZE does mean that kernel version 3.4 or greater is required, so I updated the readme to reflect that.

kidd commented 7 years ago

cool! thanks!

It works now.