1 #if defined(__64BIT__) && defined(RS6K) 9 typedef long long int ll_t;
15 #if defined(__64BIT__) 19 #include <sys/procfs.h> 26 static int fd = -9999;
27 static ll_t stackbase = 0;
35 snprintf(procfile,
sizeof(procfile),
"/proc/%d/status",pid);
36 fd = open(procfile, O_RDONLY);
37 if (read(fd, &pstatus,
sizeof(pstatus)) ==
sizeof(pstatus)) {
38 stackbase = (
ll_t)pstatus.pr_stkbase;
44 if (fd == 0 && stackbase > 0) {
45 int tid = pthread_self();
48 stackused = stackbase - (
ll_t)addr;
static pthread_t master_tid
int snprintf(char *str, size_t size, const char *format,...)