remove duplicated split, trim
move sigset_t to common code