Thanks for writing this useful program. When I tried to compile it on, make gave me the following error:
cc -Wall -Werror -D_GNU_SOURCE -g -c -o reptyr.o reptyr.c
cc -Wall -Werror -D_GNU_SOURCE -g -c -o ptrace.o ptrace.c
In file included from ptrace.c:2:0:
/usr/include/sys/user.h:32:3: error: expected specifier-qualifier-list before ‘__uint16_t’
make: *** [ptrace.o] Error 1
The solution was to include <sys/types.h> before <sys/user.h>, as in the attached commit.
Fix a compiler error in ptrace.c
On some systems, including sys/user.h before sys/types.h causes a
compiler error. Changing the order of the #includes fixes the error.