ptrace code example from linuxjournal and more