File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,14 @@ bool process_kill_unix(stdlib_pid pid) {
284
284
return false;
285
285
}
286
286
287
+ // send signal to a process. returns true if success, else false.
288
+ bool process_send_signal_unix (stdlib_pid pid , int signal ) {
289
+ if (kill (pid , signal ) == 0 ) {
290
+ return true;
291
+ }
292
+
293
+ return false; // errors occurred
294
+ }
287
295
288
296
// On UNIX systems: just fork a new process. The command line will be executed from Fortran.
289
297
void process_create_posix (stdlib_pid * pid )
@@ -329,6 +337,17 @@ bool process_kill(stdlib_pid pid)
329
337
#endif // _WIN32
330
338
}
331
339
340
+ // Cross-platform interface: send signal to a process by ID
341
+ // no-op on Windows
342
+ bool process_send_signal (stdlib_pid pid , int signal )
343
+ {
344
+ #ifndef _WIN32
345
+ return process_send_signal_unix (pid , signal );
346
+ #else
347
+ return false;
348
+ #endif
349
+ }
350
+
332
351
// Cross-platform interface: sleep(seconds)
333
352
void process_wait (float seconds )
334
353
{
You can’t perform that action at this time.
0 commit comments