Sto lavorando in glibc e ho bisogno di ottenere l'id del thread corrente. Per questo io uso syscall(SYS_gettid);
Il problema è che, sono costretto a includere bits/syscall.h
invece del caso ideale i.e sys/syscall.h
.chiamata gettid witin glibc
sys/syscall.h
chiama internamente bits/syscall.h
ma è incluso nella macro #ifndef _LIBC
. cioè
#ifndef _LIBC
/* The Linux kernel header file defines macros `__NR_<name>', but some
programs expect the traditional form `SYS_<name>'. So in building libc
we scan the kernel's list and produce <bits/syscall.h> with macros for
all the `SYS_' names. */
# include <bits/syscall.h>
#endif
anche bits/syscall.h
afferma che "Non utilizzare mai bit/syscall.h direttamente;. comprendono sys/syscall.h invece"
Dal sarà definito nel mio caso come sto scrivendo il codice direttamente in malloc.c
, si prega di suggerire il mio come posso superare questo.
Grazie, Kapil
Perché non usi solo "__NR_gettid'? –