#!/usr/bin/python3
import os
import time
os.system('/bin/kill -19 ' + str(os.getpid()))
time.sleep(2)
On Linux this script returns immediately, suspended. On Mac this script waits for two seconds and exits without suspending itself.
What can I do to make the suspension behavior available on Mac?
TIA,
IPC Signal 19
seems to be not supported in MacOS. You can use -s SIGSTOP
to suspend the process.
import os
import time
os.system(f'/bin/kill -s SIGSTOP {os.getpid()}')
time.sleep(2)