linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gunnar Larisch <gunmuc@googlemail.com>
To: "Mirski Paweł" <mirskip87@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Problem with infinite loop in signal handler
Date: Sun, 26 Jul 2009 15:58:38 +0200	[thread overview]
Message-ID: <20090726135838.GA5951@balu.adler.nest> (raw)
In-Reply-To: <62c21b850907242234r5ec8f6f9tc8ccb2e412306312@mail.gmail.com>

Hi Mirski,

your signal handler function:

> >> void suspend(int sig) {
> >>    printf("suspending\n");
> >>    fflush(stdout);
> >>    while(1);
> >> }

Have you also tried your programm without calling printf and fflush in the
signal handler? Do you know the manpage signal (7) ? There is a list of
Async-signal-safe functions.

Can you tell me, why you need an endless loop in the signal
handler?

Regards,
Gunnar
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-07-26 13:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22 16:42 Problem with infinite loop in signal handler Mirski Paweł
2009-07-22 20:31 ` Gedare Bloom
2009-07-25  5:34   ` Mirski Paweł
2009-07-26 13:58     ` Gunnar Larisch [this message]
2009-07-28  6:45       ` Mirski Paweł

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090726135838.GA5951@balu.adler.nest \
    --to=gunmuc@googlemail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mirskip87@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).