nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.82k stars 215 forks source link

build on older glibc #25

Closed glensc closed 11 years ago

glensc commented 11 years ago

i have old glibc 2.3 system where PTRACE_SETOPTIONS and PTRACE_GETEVENTMSG are not available. but the defines are present in newer version of linux-libc-headers

when compiling with manually defining the values or including linux/ptrace.h resulting binary seems working fine.

fix variant 1:

#ifndef PTRACE_SETOPTIONS
#define PTRACE_SETOPTIONS   0x4200
#endif
#define PTRACE_GETEVENTMSG  0x4201
#ifndef PTRACE_GETEVENTMSG
#endif

fix variant 2:

#include <linux/ptrace.h>

in that system:

linux-libc-headers-2.6.33.20-1.amd64
glibc-devel-2.3.6-18.amd64

tested resultng binary on 2.6.27.45-1 kernel with bc program.

nelhage commented 11 years ago

Thanks for the report. I think including <linux/ptrace.h> should be fine. Want to send along a pull reqest?

glensc commented 11 years ago

ok committed and pushed. can you merge that, or you need real PR?

nelhage commented 11 years ago

Thanks, merged