public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: chikayama@klic.org
To: cygwin@sourceware.cygnus.com
Cc: chikayama@klic.org
Subject: B20.1: Setitimer provides virtual timer?
Date: Wed, 11 Aug 1999 19:26:00 -0000	[thread overview]
Message-ID: <19990812112810X.chik@klic.org> (raw)

"setitimer(ITIMER_VIRTUAL, ...)" does not seem to deliver SIGVTALRM
signals.  The test program included below, that sets the process timer
and loops awaiting for timer expiration, will loop forever.  However,
running this in background and sending the signal by "kill -VTALRM ..."
from the shell will terminate it as expected (with an exclamation mark 
output).

Is this the spec. of the current release or a bug?

# I really enjoy using Cygwin.  Thank you for your efforts!

-- Takashi Chikayama@Dept. of Frontier Informatics., the Univ. of Tokyo
-- Tel. +81-3-5841-6658; Fax. +81-3-5841-8572
-- E-mail chikayama@klic.org; Home page http://www.logos.t.u-tokyo.ac.jp
\f
#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

volatile int time_has_come;

void handler(int signal)
{
  time_has_come = 1;
  fprintf(stderr, "!\n");
  return;
}

struct itimerval interval;

int main(int argc, char * const argv[])
{
  interval.it_interval.tv_sec = 0;
  interval.it_interval.tv_usec = 0;
  interval.it_value.tv_sec = 1;
  interval.it_value.tv_usec = 0;
  signal(SIGVTALRM, handler);
  (void) setitimer(ITIMER_VIRTUAL, &interval, NULL);
  time_has_come = 0;
  while (1) {
    if (time_has_come) {
      exit(0);
    }
  }
}

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

WARNING: multiple messages have this Message-ID
From: chikayama@klic.org
To: cygwin@sourceware.cygnus.com
Cc: chikayama@klic.org
Subject: B20.1: Setitimer provides virtual timer?
Date: Tue, 31 Aug 1999 23:49:00 -0000	[thread overview]
Message-ID: <19990812112810X.chik@klic.org> (raw)
Message-ID: <19990831234900.-9NF_TUFGSBVI3zlJ9ZlZE_-OEcMohupZFgWhoJ2KF8@z> (raw)

"setitimer(ITIMER_VIRTUAL, ...)" does not seem to deliver SIGVTALRM
signals.  The test program included below, that sets the process timer
and loops awaiting for timer expiration, will loop forever.  However,
running this in background and sending the signal by "kill -VTALRM ..."
from the shell will terminate it as expected (with an exclamation mark 
output).

Is this the spec. of the current release or a bug?

# I really enjoy using Cygwin.  Thank you for your efforts!

-- Takashi Chikayama@Dept. of Frontier Informatics., the Univ. of Tokyo
-- Tel. +81-3-5841-6658; Fax. +81-3-5841-8572
-- E-mail chikayama@klic.org; Home page http://www.logos.t.u-tokyo.ac.jp
\f
#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

volatile int time_has_come;

void handler(int signal)
{
  time_has_come = 1;
  fprintf(stderr, "!\n");
  return;
}

struct itimerval interval;

int main(int argc, char * const argv[])
{
  interval.it_interval.tv_sec = 0;
  interval.it_interval.tv_usec = 0;
  interval.it_value.tv_sec = 1;
  interval.it_value.tv_usec = 0;
  signal(SIGVTALRM, handler);
  (void) setitimer(ITIMER_VIRTUAL, &interval, NULL);
  time_has_come = 0;
  while (1) {
    if (time_has_come) {
      exit(0);
    }
  }
}

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

             reply	other threads:[~1999-08-11 19:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-11 19:26 chikayama [this message]
1999-08-11 20:45 ` Fergus Henderson
1999-08-31 23:49   ` Fergus Henderson
1999-08-12 14:26 ` Chris Faylor
1999-08-31 23:49   ` Chris Faylor
1999-08-31 23:49 ` chikayama

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=19990812112810X.chik@klic.org \
    --to=chikayama@klic.org \
    --cc=cygwin@sourceware.cygnus.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 read-only IMAP folder(s) and NNTP newsgroup(s).