Support sigprocmask and add a test.