#define _GNU_SOURCE
#include <sched.h>
int main()
{
cpu_set_t set;
CPU_SET(0, &set);
return 0;
} root@Csabi:~# gcc fasz.c
root@Csabi:~# #define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
int main()
{
cpu_set_t set;
CPU_SET(0, &set);
return 0;
} root@Csabi:~# gcc fasz.c
root@Csabi:~# #include <stdio.h>
#define _GNU_SOURCE
#include <sched.h>
int main()
{
cpu_set_t set;
CPU_SET(0, &set);
return 0;
} root@Csabi:~# gcc fasz.c
/tmp/ccxm2ziW.o: In function `main':
fasz.c:(.text+0x1a): undefined reference to `CPU_SET'
collect2: error: ld returned 1 exit status
root@Csabi:~# Magyarán, ha a kibaszott _GNU_SOURCE makró az után van definiálva, hogy valamilyen sys-include-ot behúzol, akkor nem fogja figyelembe venni... UNDORÍTÓ!!!
Így próbáljon az ember Linux támogatású cross-platform programot írni! |