signal stuff not included on BSD 4.2 or SunOs
This commit is contained in:
parent
dfcbc661ca
commit
abb71310d2
|
@ -1,7 +1,9 @@
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
/* channel.c - basic channel handling routines */
|
/* channel.c - basic channel handling routines */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#ifndef __BSD4_2
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
#define __CHANNEL__
|
#define __CHANNEL__
|
||||||
#ifdef __USG
|
#ifdef __USG
|
||||||
#include <termio.h>
|
#include <termio.h>
|
||||||
|
@ -112,7 +114,9 @@ void chan_out(v, c) long v; register chan *c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __BSD4_2
|
||||||
static int timeout();
|
static int timeout();
|
||||||
|
#endif
|
||||||
|
|
||||||
int chan_any(c) register chan *c;
|
int chan_any(c) register chan *c;
|
||||||
{
|
{
|
||||||
|
@ -189,6 +193,7 @@ int chan_any(c) register chan *c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __BSD4_2
|
||||||
/* The ch=getc(fp) in the above function calls read(2) to do its task, but if
|
/* The ch=getc(fp) in the above function calls read(2) to do its task, but if
|
||||||
* there's no input on the file (pipe or terminal) then the read will block.
|
* there's no input on the file (pipe or terminal) then the read will block.
|
||||||
* To stop this read from blocking, we use the fact that if the read is
|
* To stop this read from blocking, we use the fact that if the read is
|
||||||
|
@ -204,6 +209,7 @@ static int timeout(sig)
|
||||||
signal(SIGALRM, timeout);
|
signal(SIGALRM, timeout);
|
||||||
alarm(1);
|
alarm(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void disaster()
|
static void disaster()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue