Linux3.2.0
Given the following source:
#include <stdio.h>
#include <sched.h>
int main(void)
{
printf("%i \n", CLONE_PTRACE);
return 0;
}
I get:
test.c: In function ‘main’:
test.c:6:18: error: ‘CLONE_PTRACE’ undeclared (first use in this function)
Why?
You need to
#define _GNU_SOURCEone way or another to get those constants. (See theclone(2)man page.)With your code saved as
t.c: