aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/src/signal.h
blob: 0dda6eee6591ac3329b05d7ee1efacc9ef7b9ed6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10






                                                          


                    

                       
                   
 
                                    
                             
 
                                        
 


                                      
                                                                                              


                                    
      
/*
 * Copyright (c) 2022 Egor Tensin <Egor.Tensin@gmail.com>
 * This file is part of the "cimple" project.
 * For details, see https://github.com/egor-tensin/cimple.
 * Distributed under the MIT License.
 */

#ifndef __SIGNAL_H__
#define __SIGNAL_H__

#include "event_loop.h"

#include <signal.h>

int signal_block_all(sigset_t *old);
int signal_block_stops(void);

int signal_restore(const sigset_t *new);

int signalfd_create(const sigset_t *);
void signalfd_destroy(int fd);

int signalfd_add_to_event_loop(int fd, struct event_loop *, event_handler handler, void *arg);

int signalfd_listen_for_stops(void);

#endif