230 #elif __amd64__
231 #define SYS_gettid 186
232 #elif __sparc__
233 #define SYS_gettid 143
234 #else
235 #error define gettid for the arch
236 #endif
237 #endif
238
239 // Cpu architecture string
240 #if defined(ZERO)
241 static char cpu_arch[] = ZERO_LIBARCH;
242 #elif defined(IA64)
243 static char cpu_arch[] = "ia64";
244 #elif defined(IA32)
245 static char cpu_arch[] = "i386";
246 #elif defined(AMD64)
247 static char cpu_arch[] = "amd64";
248 #elif defined(ARM)
249 static char cpu_arch[] = "arm";
250 #elif defined(PPC)
251 static char cpu_arch[] = "ppc";
252 #elif defined(SPARC)
253 # ifdef _LP64
254 static char cpu_arch[] = "sparcv9";
255 # else
256 static char cpu_arch[] = "sparc";
257 # endif
258 #else
259 #error Add appropriate cpu_arch setting
260 #endif
261
262
263 // pid_t gettid()
264 //
265 // Returns the kernel thread id of the currently running thread. Kernel
266 // thread id is used to access /proc.
267 //
268 // (Note that getpid() on LinuxThreads returns kernel thread id too; but
269 // on NPTL, it returns the same pid for all threads, as required by POSIX.)
270 //
|
230 #elif __amd64__
231 #define SYS_gettid 186
232 #elif __sparc__
233 #define SYS_gettid 143
234 #else
235 #error define gettid for the arch
236 #endif
237 #endif
238
239 // Cpu architecture string
240 #if defined(ZERO)
241 static char cpu_arch[] = ZERO_LIBARCH;
242 #elif defined(IA64)
243 static char cpu_arch[] = "ia64";
244 #elif defined(IA32)
245 static char cpu_arch[] = "i386";
246 #elif defined(AMD64)
247 static char cpu_arch[] = "amd64";
248 #elif defined(ARM)
249 static char cpu_arch[] = "arm";
250 #elif defined(PPC32)
251 static char cpu_arch[] = "ppc";
252 #elif defined(SPARC)
253 # ifdef _LP64
254 static char cpu_arch[] = "sparcv9";
255 # else
256 static char cpu_arch[] = "sparc";
257 # endif
258 #else
259 #error Add appropriate cpu_arch setting
260 #endif
261
262
263 // pid_t gettid()
264 //
265 // Returns the kernel thread id of the currently running thread. Kernel
266 // thread id is used to access /proc.
267 //
268 // (Note that getpid() on LinuxThreads returns kernel thread id too; but
269 // on NPTL, it returns the same pid for all threads, as required by POSIX.)
270 //
|