forked from bloomberg/pystack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpthread.h
More file actions
70 lines (62 loc) · 1.38 KB
/
pthread.h
File metadata and controls
70 lines (62 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include <cstdint>
#include <unistd.h>
namespace pystack {
// The following is the pthread structure and all
// type requirements taking from GLIB. Check the following
// for more information:
// https://github.com/bminor/glibc/blob/78fb88827362fbd2cc8aa32892ae5b015106e25c/nptl/descr.h#L130-L176
typedef struct
{
int i[4];
} __128bits;
typedef struct
{
void* tcb;
void* dtv;
void* self;
int multiple_threads;
int gscope_flag;
uintptr_t sysinfo;
uintptr_t stack_guard;
uintptr_t pointer_guard;
unsigned long unused_vgetcpu_cache[2];
unsigned int feature_1;
int __glibc_unused1;
void* __private_tm[4];
void* __private_ss;
unsigned long long ssp_base;
__128bits __glibc_unused2[8][4] __attribute__((aligned(32)));
void* __padding[8];
} __tcbhead_t;
typedef struct
{
union {
struct
{
int multiple_threads;
int gscope_flag;
} header;
void* __padding[24];
};
struct
{
struct list_head* next;
struct list_head* prev;
} list;
pid_t tid;
} _pthread_structure_with_simple_header;
typedef struct
{
union {
__tcbhead_t header;
void* __padding[24];
};
struct
{
struct list_head* next;
struct list_head* prev;
} list;
pid_t tid;
} _pthread_structure_with_tcbhead;
} // namespace pystack