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) {
284284 return false;
285285}
286286
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+ }
287295
288296// On UNIX systems: just fork a new process. The command line will be executed from Fortran.
289297void process_create_posix (stdlib_pid * pid )
@@ -329,6 +337,17 @@ bool process_kill(stdlib_pid pid)
329337#endif // _WIN32
330338}
331339
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+
332351// Cross-platform interface: sleep(seconds)
333352void process_wait (float seconds )
334353{
You can’t perform that action at this time.
0 commit comments