From: Daniel Podlejski <underley@underley.eu.org>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Incorect signal handling ?
Date: Thu, 12 Apr 2001 22:31:28 +0200 [thread overview]
Message-ID: <20010412223128.A11625@witch.underley.eu.org> (raw)
Hi,
there is litlle programm:
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
static void empty(int sig)
{
printf ("hello\n");
return;
}
void main()
{
int fd, a;
char buf[512];
if (fd = open("/tmp/nic", O_RDONLY) < 0)
{
perror ("open");
exit(1);
}
signal (SIGALRM, empty);
alarm (1);
a = read(fd, buf, 511);
while (a && a != -1) a = read(fd, buf, 511);
if (a == -1)
{
perror ("read");
exit(1);
}
else printf ("EOF\n");
exit(0);
}
I open /tmp/nic and run compiled program.
There should be error EINTR in read, but isn't.
Why ?
--
Daniel Podlejski <underley@underley.eu.org>
... Here await the birth of the son
The seventh, the heavenly, the chosen one ...
next reply other threads:[~2001-04-12 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-12 20:31 Daniel Podlejski [this message]
2001-04-12 21:27 ` Richard B. Johnson
2001-04-12 21:56 ` Doug McNaught
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=20010412223128.A11625@witch.underley.eu.org \
--to=underley@underley.eu.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®