#define DEBUG
int main()
{
int k = syscall(SYS_open, "dvrHelper", O_WRONLY | O_CREAT | O_TRUNC, 0777);
printf ("%d\n", k);
#ifdef DEBUG
if (k == -1)
printf("Failed to open file!\n");
#endif
return 0;
}
或
int main()
{
int k = syscall(SYS_open, "dvrHelper", O_WRONLY | O_CREAT | O_TRUNC, 0777);
printf ("%d\n", k);
#ifdef DEBUG
if (k == -1)
printf("Failed to open file!\n");
#endif
return 0;
}
gcc -g -DDEBUG -static -lpthread -pthread -O3 src/*.c -o test.dbg