70 #endif
71 #if defined(aarch64) || defined(arm64)
72 #include <asm/ptrace.h>
73 #define user_regs_struct user_pt_regs
74 #elif defined(arm)
75 #include <asm/ptrace.h>
76 #define user_regs_struct pt_regs
77 #endif
78
79 // This C bool type must be int for compatibility with Linux calls and
80 // it would be a mistake to equivalence it to C++ bool on many platforms
81
82 typedef int bool;
83 #define true 1
84 #define false 0
85
86 struct ps_prochandle;
87
88 // attach to a process
89 JNIEXPORT struct ps_prochandle* JNICALL
90 Pgrab(pid_t pid, char* err_buf, size_t err_buf_len);
91
92 // attach to a core dump
93 JNIEXPORT struct ps_prochandle* JNICALL
94 Pgrab_core(const char* execfile, const char* corefile);
95
96 // release a process or core
97 JNIEXPORT void JNICALL
98 Prelease(struct ps_prochandle* ph);
99
100 // functions not directly available in Solaris libproc
101
102 // initialize libproc (call this only once per app)
103 // pass true to make library verbose
104 JNIEXPORT bool JNICALL
105 init_libproc(bool verbose);
106
107 // get number of threads
108 int get_num_threads(struct ps_prochandle* ph);
109
110 // get lwp_id of n'th thread
|
70 #endif
71 #if defined(aarch64) || defined(arm64)
72 #include <asm/ptrace.h>
73 #define user_regs_struct user_pt_regs
74 #elif defined(arm)
75 #include <asm/ptrace.h>
76 #define user_regs_struct pt_regs
77 #endif
78
79 // This C bool type must be int for compatibility with Linux calls and
80 // it would be a mistake to equivalence it to C++ bool on many platforms
81
82 typedef int bool;
83 #define true 1
84 #define false 0
85
86 struct ps_prochandle;
87
88 // attach to a process
89 JNIEXPORT struct ps_prochandle* JNICALL
90 Pgrab(pid_t pid, char* err_buf, size_t err_buf_len, bool is_in_container);
91
92 // attach to a core dump
93 JNIEXPORT struct ps_prochandle* JNICALL
94 Pgrab_core(const char* execfile, const char* corefile);
95
96 // release a process or core
97 JNIEXPORT void JNICALL
98 Prelease(struct ps_prochandle* ph);
99
100 // functions not directly available in Solaris libproc
101
102 // initialize libproc (call this only once per app)
103 // pass true to make library verbose
104 JNIEXPORT bool JNICALL
105 init_libproc(bool verbose);
106
107 // get number of threads
108 int get_num_threads(struct ps_prochandle* ph);
109
110 // get lwp_id of n'th thread
|