borrow from psignal.h so that we can define contexts