Never tried linux Custom signal , Look up the , The system only provides SIGUSR1 and SIGUSR2 Two , Is two enough ? What's more, if you want to customize signals like #define SIG_MYSIG   .... If you want to change the kernel , Brother collapsed in a flash , I used to be interested in linux There was no respect for him , Fortunately, we found a way here

http://bbs.chinaunix.net/viewthread.php?tid=989499

That is, it can be , According to this #define MYSIG_MSG        SIGUSR1 + 20 After the definition , It is found that the program always stops running immediately , use eclipse Jump over and have a look #define    SIGUSR1        10    /* User-defined signal 1 (POSIX).  */, And add 20 It becomes 30,30 What is it? ?30 yes #define    SIGPWR        30  , open 《UNIX Environment advanced programming 》 This is a power failure or restart . Which great Xia first said that he was SIGUSR1 Based on the definition of ? I don't believe you succeeded in the experiment !!!!!!!!!!!!

The right way is in __SIGRTMIN(32) Based on the definition of ,__SIGRTMIN(32) To __SIGRTMAX(64) It's a real-time signal that's left , So I defined #define SIG_RECVDATA    __SIGRTMIN+1,

But still not ? Several other non static member functions of the program have caused enough trouble , I thought there was something wrong with those places , Only to find out signal Invocation time signal(SIG_RECVDATA,InternalRecvSigHandler), It always comes back SIG_ERR, That is to say, from the very beginning, the signal registration was not successful , Don't 32-64 It's a real-time signal reserved by the system , Not for developers ??, After a struggle , stay CSDN In the last few short replies, I found that __SIGRTMIN Based on the former 3 You'd better not use it , It is linuxthread With , It's a pain in the egg , You need to use it internally The words of __SIGRTMIN A bigger definition , All in all __SIGRTMIN and __SIGRTMAX It's good that you can use it !!

Finally, it was changed to #define SIG_RECVDATA    __SIGRTMIN+10, Ah , It's a success !

linux More articles on custom signals

  1. Linux Signal usage and custom signal

    linux Custom signal :https://www.cnblogs.com/bigben0123/p/3186661.html linux The signal . Value and explanation :https://blog.csdn.net/luot ...

  2. Qt User defined signal and slot function

    Custom signal and slot functions : 1. The declaration and implementation of the class are placed in .h and .cpp In file : 2. Class declaration contains Q_OBJECT macro : 3. The signal only needs to declare and not design its implementation function 4. Transmit signal with emit keyword 5. The implementation of custom slot is similar to that of ordinary slot ...

  3. linux kill Signal list

    linux kill Signal list $ kill -l1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL5) SIGTRAP      6) ...

  4. Linux Custom command

    linux Custom command , Is to give the current command an alias . such as :ls List the current files ,rm + file name You can delete the file , How to customize commands , have access to alias such as :alias gobin='cd /opt/tomca ...

  5. Linux Interprocess communication —— Signal set function

    One . What is a signal Used to Windows We all know , When we can't finish a program properly , You can force the process to end with task manager , But how is this actually achieved ? The same function in Linux This is achieved by generating and capturing signals , Running ...

  6. 【PyQt5-Qt Designer】pyqtSignal()- Advanced custom signals and slots

    PyQt 5 Several advanced playing methods of signal and slot Reference resources :http://www.broadview.com.cn/article/824 from PyQt5.QtCore import QObject , pyqt ...

  7. linux Custom boot service and chkconfig Usage method

    linux Custom boot service and chkconfig Usage method 1. Service overview in linux Under the operating system , You often need to create services , These services are made shell Script , These services need to be started automatically when the system is started , It turns off automatically ...

  8. Qt Way of learning 2(5): Custom signal slot

    Home / Qt Way of learning 2 / Qt Way of learning 2(5): Custom signal slot Qt Way of learning 2(5): Custom signal slot   Bean   2012 year 8 month 24 Japan   Qt Way of learning 2  131 comments In the last section, we discussed ...

  9. ( turn )linux Custom boot service and chkconfig Usage method

    original text :https://www.cnblogs.com/jimeper/archive/2013/03/12/2955687.html linux Custom boot service and chkconfig Usage method 1. clothing ...

Random recommendation

  1. Talking about fls3 A compression problem of

    yesterday , use fis3 Compression optimization , When running a command on the command line , There's an error message . not a PNG file. A lot of information , No solution found , Finally in the github Ask questions , There is a positive answer : It's because some pictures have suffixes through ...

  2. Linux Start Management :grub

    1.grub The middle partition represents Linux in /dev/sda1   stay grub In Chinese, it means   hd0,0     Represents the first partition of the first hard disk Linux in /dev/sdb3 It's an extended partition     stay grub In Chinese, it means   ...

  3. adopt IIS debugging ASP.NET project

    When we use Visual Studio When debugging , Usually we choose VS Self contained ASP.NET Developerment Server( It's also the default option ), When I first debugged ( Press F5 or Ctrl+F5 Do not debug directly ...

  4. replace Eval Two ways

    stay asp.net Data binding in , We often use Eval, But you all know Eval Binding is done by reflection , Reflection is bound to have an impact on performance . But there are two alternatives to binding data , Slightly improved performance . 1 When the number of ...

  5. HDU1686——Oulipo

    Problem Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, w ...

  6. php Use composer

    I've written about it before composer, Then I met some friends and asked me , I've sorted out , It's convenient for you to check it in the future ~~ Programmers who don't play open source are not good cooks     1. Perform online installation         curl -sS https: ...

  7. PHP Get client and server IP( turn )

    Client's ip Variable : $_SERVER['REMOTE_ADDR'] : client IP, It could be an agent IP $_SERVER['HTTP_CLIENT_IP']: Agent side IP, Possible , It can also be forged $_SE ...

  8. Android learning Animation( Two )

    And then last time View Animation Animation , This time it is Frame Animation. To be specific, it's in Frame On the level of change in the animation effect settings . To put it bluntly, it is to change it regularly " background " chart . To make a difference ...

  9. 【59】Quartz+Spring Detailed explanation framework

    What is? Quartz Quartz It's a job scheduling system (a job scheduling system),Quartz Not only can it be integrated into other software systems , And it can also run independently : In this paper "job sc ...

  10. unity3d And C# WaitFOrSeconds()

    Study unity3d Soon . In the use of WaitFOrSeconds() when , There was a lot of trouble , So record , To warn future generations . First introduced C# and javascript There's a big difference in using it . javascript Be able to use... Directly ...