[pgsql@localhost tst]$ cat sig01.c
#include <stdio.h>
#include <signal.h>

static void
trapsigterm(int signum)
{
        fprintf(stderr,"+++++++++++Got SIGTERM with %d\n",signum);
}

static void
trapsigquit(int signum)

{
        fprintf(stderr,"+++++++++++Got SIGQUIT with %d\n",signum);
}

int main()
{

   signal(SIGTERM,trapsigterm);
   signal(SIGQUIT,trapsigquit);
   
   sleep(10);

   return 0;

}
[pgsql@localhost tst]$ 

 

相关文章:

  • 2021-10-24
  • 2021-07-17
  • 2022-01-21
  • 2021-08-12
  • 2021-07-25
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2022-02-25
  • 2021-08-27
  • 2021-06-08
  • 2021-05-31
  • 2022-12-23
相关资源
相似解决方案