tcb-offsets.sym

来自「glibc 库, 不仅可以学习使用库函数,还可以学习函数的具体实现,是提高功力的」· SYM 代码 · 共 18 行

SYM
18
字号
#include <sysdep.h>#include <tls.h>---- Abuse tls.h macros to derive offsets relative to the thread register.# undef __thread_register# define __thread_register	((void *) 0)# define thread_offsetof(mem)	((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))#if TLS_MULTIPLE_THREADS_IN_TCBMULTIPLE_THREADS_OFFSET		thread_offsetof (header.multiple_threads)#endifPID				thread_offsetof (pid)TID				thread_offsetof (tid)POINTER_GUARD			(offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?