我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用signal.SIGTTIN。
def make_default_signal_map(): """ Make the default signal map for this system. :return: A mapping from signal number to handler object. The signals available differ by system. The map will not contain any signals not defined on the running system. """ name_map = { 'SIGTSTP': None, 'SIGTTIN': None, 'SIGTTOU': None, 'SIGTERM': 'terminate', } signal_map = dict( (getattr(signal, name), target) for (name, target) in name_map.items() if hasattr(signal, name)) return signal_map
def _setup_signal_handlers(self): """Setup the signal handlers for daemon mode""" signals = self.signals # Ignore Terminal I/O Signals if hasattr(signal, 'SIGTTOU'): signals.ignore(signal.SIGTTOU) if hasattr(signal, 'SIGTTIN'): signals.ignore(signal.SIGTTIN) if hasattr(signal, 'SIGTSTP'): signals.ignore(signal.SIGTSTP) # Ignore USR signals if hasattr(signal, 'SIGUSR1'): signals.ignore(signal.SIGUSR1) if hasattr(signal, 'SIGUSR2'): signals.ignore(signal.SIGUSR2)