MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / siginfo_create

Function siginfo_create

components/lwp/lwp_signal.c:35–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static lwp_siginfo_t siginfo_create(rt_thread_t current, int signo, int code, lwp_siginfo_ext_t ext)
36{
37 lwp_siginfo_t siginfo;
38 struct rt_lwp *self_lwp;
39 rt_thread_t self_thr;
40
41 siginfo = rt_malloc(sizeof(*siginfo));
42 if (siginfo)
43 {
44 siginfo->ksiginfo.signo = signo;
45 siginfo->ksiginfo.code = code;
46 siginfo->ext = ext;
47
48 self_thr = current;
49 self_lwp = current->lwp;
50 if (self_lwp)
51 {
52 siginfo->ksiginfo.from_pid = self_lwp->pid;
53 siginfo->ksiginfo.from_tid = self_thr->tid;
54 }
55 else
56 {
57 siginfo->ksiginfo.from_pid = 0;
58 siginfo->ksiginfo.from_tid = 0;
59 }
60 }
61
62 return siginfo;
63}
64
65rt_inline void siginfo_delete(lwp_siginfo_t siginfo)
66{

Callers 2

lwp_signal_killFunction · 0.85
lwp_thread_signal_killFunction · 0.85

Calls 1

rt_mallocFunction · 0.85

Tested by

no test coverage detected