Does the default action of SIGCONT resume the execution of a stopped process before or after first handling...












0














http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 says:




The default action for SIGCONT is to resume execution at the point where the process was stopped, after first handling any pending unblocked signals.




What does "after" mean here? Shouldn't it be "before" instead?
Is there some example to show what it means?



Similarly from APUE:




Since the process group is orphaned when the parentterminates, POSIX.1 requires that every process in the newly orphaned process
group that is stopped (as our child is) be sent the hang-up signal
(SIGHUP) followed by the continue signal (SIGCONT)



This causes the child to be continued, after processing the hang-up signal. The default action for the hang-up signal is to
terminate the process, so we have to provide a signal handler to catch
the signal. We therefore expect the printf in the sig_hup function to
appear before the printf in the pr_ids function.




Shouldn't "after" be "before" instead?



https://stackoverflow.com/a/17769300/156458 seems to suggest "before" instead of "after" in the above two quotes, or I misunderstand it:




The SIGHUP cannot be delivered until the child's execution is resumed.
When a process is stopped, all signal delivery is suspended except for
SIGCONT and SIGKILL.



So, the SIGHUP does arrive first, but it cannot be processed until the
SIGCONT awakens the process execution.




Thanks.



https://stackoverflow.com/questions/50635458/when-several-signals-arrive-at-a-process-what-is-the-order-between-the-process#comment94663185_50671773










share|improve this question





























    0














    http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 says:




    The default action for SIGCONT is to resume execution at the point where the process was stopped, after first handling any pending unblocked signals.




    What does "after" mean here? Shouldn't it be "before" instead?
    Is there some example to show what it means?



    Similarly from APUE:




    Since the process group is orphaned when the parentterminates, POSIX.1 requires that every process in the newly orphaned process
    group that is stopped (as our child is) be sent the hang-up signal
    (SIGHUP) followed by the continue signal (SIGCONT)



    This causes the child to be continued, after processing the hang-up signal. The default action for the hang-up signal is to
    terminate the process, so we have to provide a signal handler to catch
    the signal. We therefore expect the printf in the sig_hup function to
    appear before the printf in the pr_ids function.




    Shouldn't "after" be "before" instead?



    https://stackoverflow.com/a/17769300/156458 seems to suggest "before" instead of "after" in the above two quotes, or I misunderstand it:




    The SIGHUP cannot be delivered until the child's execution is resumed.
    When a process is stopped, all signal delivery is suspended except for
    SIGCONT and SIGKILL.



    So, the SIGHUP does arrive first, but it cannot be processed until the
    SIGCONT awakens the process execution.




    Thanks.



    https://stackoverflow.com/questions/50635458/when-several-signals-arrive-at-a-process-what-is-the-order-between-the-process#comment94663185_50671773










    share|improve this question



























      0












      0








      0


      0





      http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 says:




      The default action for SIGCONT is to resume execution at the point where the process was stopped, after first handling any pending unblocked signals.




      What does "after" mean here? Shouldn't it be "before" instead?
      Is there some example to show what it means?



      Similarly from APUE:




      Since the process group is orphaned when the parentterminates, POSIX.1 requires that every process in the newly orphaned process
      group that is stopped (as our child is) be sent the hang-up signal
      (SIGHUP) followed by the continue signal (SIGCONT)



      This causes the child to be continued, after processing the hang-up signal. The default action for the hang-up signal is to
      terminate the process, so we have to provide a signal handler to catch
      the signal. We therefore expect the printf in the sig_hup function to
      appear before the printf in the pr_ids function.




      Shouldn't "after" be "before" instead?



      https://stackoverflow.com/a/17769300/156458 seems to suggest "before" instead of "after" in the above two quotes, or I misunderstand it:




      The SIGHUP cannot be delivered until the child's execution is resumed.
      When a process is stopped, all signal delivery is suspended except for
      SIGCONT and SIGKILL.



      So, the SIGHUP does arrive first, but it cannot be processed until the
      SIGCONT awakens the process execution.




      Thanks.



      https://stackoverflow.com/questions/50635458/when-several-signals-arrive-at-a-process-what-is-the-order-between-the-process#comment94663185_50671773










      share|improve this question















      http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 says:




      The default action for SIGCONT is to resume execution at the point where the process was stopped, after first handling any pending unblocked signals.




      What does "after" mean here? Shouldn't it be "before" instead?
      Is there some example to show what it means?



      Similarly from APUE:




      Since the process group is orphaned when the parentterminates, POSIX.1 requires that every process in the newly orphaned process
      group that is stopped (as our child is) be sent the hang-up signal
      (SIGHUP) followed by the continue signal (SIGCONT)



      This causes the child to be continued, after processing the hang-up signal. The default action for the hang-up signal is to
      terminate the process, so we have to provide a signal handler to catch
      the signal. We therefore expect the printf in the sig_hup function to
      appear before the printf in the pr_ids function.




      Shouldn't "after" be "before" instead?



      https://stackoverflow.com/a/17769300/156458 seems to suggest "before" instead of "after" in the above two quotes, or I misunderstand it:




      The SIGHUP cannot be delivered until the child's execution is resumed.
      When a process is stopped, all signal delivery is suspended except for
      SIGCONT and SIGKILL.



      So, the SIGHUP does arrive first, but it cannot be processed until the
      SIGCONT awakens the process execution.




      Thanks.



      https://stackoverflow.com/questions/50635458/when-several-signals-arrive-at-a-process-what-is-the-order-between-the-process#comment94663185_50671773







      linux signals






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 24 '18 at 18:03

























      asked Dec 24 '18 at 17:55









      Tim

      26.1k74246455




      26.1k74246455






















          2 Answers
          2






          active

          oldest

          votes


















          2














          No, it means after. The key is "resume execution at the point where the process was stopped".



          Signal processing is performed first, and then execution continues.






          share|improve this answer





























            2














            https://github.com/torvalds/linux/blob/master/kernel/signal.c
            POSIX 1b compliant signal kernel code



            Do a search on SIGCONT. You will see that when SIGCONT is encountered the code then looks for pending signals.






            share|improve this answer























            • Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
              – Tim
              Dec 24 '18 at 21:10










            • Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
              – jim mcnamara
              Dec 25 '18 at 5:07











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f490792%2fdoes-the-default-action-of-sigcont-resume-the-execution-of-a-stopped-process-bef%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            No, it means after. The key is "resume execution at the point where the process was stopped".



            Signal processing is performed first, and then execution continues.






            share|improve this answer


























              2














              No, it means after. The key is "resume execution at the point where the process was stopped".



              Signal processing is performed first, and then execution continues.






              share|improve this answer
























                2












                2








                2






                No, it means after. The key is "resume execution at the point where the process was stopped".



                Signal processing is performed first, and then execution continues.






                share|improve this answer












                No, it means after. The key is "resume execution at the point where the process was stopped".



                Signal processing is performed first, and then execution continues.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 24 '18 at 18:29









                Stephen Harris

                25.2k24477




                25.2k24477

























                    2














                    https://github.com/torvalds/linux/blob/master/kernel/signal.c
                    POSIX 1b compliant signal kernel code



                    Do a search on SIGCONT. You will see that when SIGCONT is encountered the code then looks for pending signals.






                    share|improve this answer























                    • Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                      – Tim
                      Dec 24 '18 at 21:10










                    • Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                      – jim mcnamara
                      Dec 25 '18 at 5:07
















                    2














                    https://github.com/torvalds/linux/blob/master/kernel/signal.c
                    POSIX 1b compliant signal kernel code



                    Do a search on SIGCONT. You will see that when SIGCONT is encountered the code then looks for pending signals.






                    share|improve this answer























                    • Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                      – Tim
                      Dec 24 '18 at 21:10










                    • Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                      – jim mcnamara
                      Dec 25 '18 at 5:07














                    2












                    2








                    2






                    https://github.com/torvalds/linux/blob/master/kernel/signal.c
                    POSIX 1b compliant signal kernel code



                    Do a search on SIGCONT. You will see that when SIGCONT is encountered the code then looks for pending signals.






                    share|improve this answer














                    https://github.com/torvalds/linux/blob/master/kernel/signal.c
                    POSIX 1b compliant signal kernel code



                    Do a search on SIGCONT. You will see that when SIGCONT is encountered the code then looks for pending signals.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 1 hour ago









                    Rui F Ribeiro

                    39.1k1479130




                    39.1k1479130










                    answered Dec 24 '18 at 18:30









                    jim mcnamara

                    513




                    513












                    • Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                      – Tim
                      Dec 24 '18 at 21:10










                    • Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                      – jim mcnamara
                      Dec 25 '18 at 5:07


















                    • Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                      – Tim
                      Dec 24 '18 at 21:10










                    • Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                      – jim mcnamara
                      Dec 25 '18 at 5:07
















                    Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                    – Tim
                    Dec 24 '18 at 21:10




                    Thanks. Could you point out which line in the source file is for "when SIGCONT is encountered the code then looks for pending signals"?
                    – Tim
                    Dec 24 '18 at 21:10












                    Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                    – jim mcnamara
                    Dec 25 '18 at 5:07




                    Try the comments found on lines 661, 862, 2028. Reading the code is time consuming , so consider starting with comments. If you search on "SIGCONT" you will find all of the comments and some of the relevant lines of code.
                    – jim mcnamara
                    Dec 25 '18 at 5:07


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f490792%2fdoes-the-default-action-of-sigcont-resume-the-execution-of-a-stopped-process-bef%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    宮崎県

                    濃尾地震

                    シテ島