@@ -89,6 +89,7 @@ struct thread_info
89
89
int ti_children ;
90
90
pthread_t ti_parent ;
91
91
struct MsgPort * ti_port ;
92
+ struct Process * ti_Process ;
92
93
};
93
94
94
95
static struct thread_info pseudo_children [MAX_THREADS ];
@@ -154,6 +155,31 @@ struct child_arg
154
155
PerlInterpreter * ca_interp ;
155
156
};
156
157
158
+ #undef kill
159
+
160
+ /* FIXME: Is here's a chance, albeit it small of a clash between our pseudo pid */
161
+ /* derived from the pthread API and the dos.library pid that newlib kill uses? */
162
+ /* clib2 used the Process address so there was no issue */
163
+
164
+ int amigaos_kill (Pid_t pid , int signal )
165
+ {
166
+ int i ;
167
+ Pid_t realpid = pid ; // Perhaps we have a real pid from else where?
168
+ /* Look for our DOS pid */
169
+ IExec -> ObtainSemaphore (& fork_array_sema );
170
+ for (i = 0 ; i < MAX_THREADS ; i ++ )
171
+ {
172
+ if (pseudo_children [i ].ti_pid == pid )
173
+ {
174
+ realpid = (Pid_t )IDOS -> GetPID (pseudo_children [i ].ti_Process ,GPID_PROCESS );
175
+ break ;
176
+ }
177
+ }
178
+ IExec -> ReleaseSemaphore (& fork_array_sema );
179
+ /* Allow the C library to work out which signals are realy valid */
180
+ return kill (realpid ,signal );
181
+ }
182
+
157
183
static THREAD_RET_TYPE amigaos4_start_child (void * arg )
158
184
{
159
185
@@ -183,6 +209,7 @@ static THREAD_RET_TYPE amigaos4_start_child(void *arg)
183
209
nextchild = getnextchild ();
184
210
185
211
pseudo_children [nextchild ].ti_pid = pseudo_id ;
212
+ pseudo_children [nextchild ].ti_Process = (struct Process * )IExec -> FindTask (NULL );
186
213
pseudo_children [nextchild ].ti_parent =
187
214
((struct child_arg * )arg )-> ca_parent ;
188
215
pseudo_children [nextchild ].ti_port =
0 commit comments