diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
commit | 437eea6fa08e931864f89be91d14a816f69075c7 (patch) | |
tree | b8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /examples/IPC_SAP/TLI_SAP/signal_thread.c | |
parent | ea0d28240863caf437a18071bfd03e7b146c5ade (diff) | |
download | ATCD-unlabeled-4.2.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'examples/IPC_SAP/TLI_SAP/signal_thread.c')
-rw-r--r-- | examples/IPC_SAP/TLI_SAP/signal_thread.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/examples/IPC_SAP/TLI_SAP/signal_thread.c b/examples/IPC_SAP/TLI_SAP/signal_thread.c deleted file mode 100644 index e3a3485f1a2..00000000000 --- a/examples/IPC_SAP/TLI_SAP/signal_thread.c +++ /dev/null @@ -1,53 +0,0 @@ -#define _REENTRANT -// @(#)signal_thread.c 1.1 10/18/96 - -#include <stdio.h> -#include <stdlib.h> -#include <signal.h> -#include <thread.h> -#include <synch.h> -#include <unistd.h> - -void *handle (v) - void *v; -{ - sigset_t set; - - sigemptyset (&set); - sigaddset (&set, SIGINT); - - for (;;) - if (sigwait (&set) != SIGINT) - perror ("sigwait"), exit (1); - else - fprintf (stderr, "got sigint!\n"); -} - -int -main (void) -{ - int retval; - sigset_t set; - thread_t t_id; - - sigemptyset (&set); - sigaddset (&set, SIGINT); - - if (sigprocmask (SIG_BLOCK, &set, 0) == -1) - perror ("sigprocmask"), exit (1); - - if (thr_sigsetmask (SIG_BLOCK, &set, 0) == -1) - perror ("sigprocmask"), exit (1); - - if (thr_create (0, 0, handle, 0, THR_DETACHED, &t_id) != 0) - perror ("thr_create"), exit (1); - - for (;;) - { - fprintf (stderr, "blocking for read in thread\n"); - if (read (0, &retval, sizeof retval) != sizeof retval) - perror ("read"); - } - fprintf (stderr, "I'm exiting!\n"); - return 0; -} |