Own fcntl.h
This commit is contained in:
parent
9ede34412c
commit
54d326e1ba
1 changed files with 0 additions and 34 deletions
|
@ -4,12 +4,7 @@
|
||||||
#ifndef __BSD4_2
|
#ifndef __BSD4_2
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
#define __CHANNEL__
|
|
||||||
#ifdef __USG
|
|
||||||
#include <termio.h>
|
|
||||||
#else
|
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
#endif
|
|
||||||
#include "ocm_chan.h"
|
#include "ocm_chan.h"
|
||||||
|
|
||||||
static void disaster();
|
static void disaster();
|
||||||
|
@ -55,46 +50,22 @@ void chan_out(v, c) long v; register chan *c;
|
||||||
switch(c->type) {
|
switch(c->type) {
|
||||||
case C_T_FILE: {
|
case C_T_FILE: {
|
||||||
register FILE *fp= unix_file[c->f.index];
|
register FILE *fp= unix_file[c->f.index];
|
||||||
#ifdef __USG
|
|
||||||
struct termio tty;
|
|
||||||
#else
|
|
||||||
struct sgttyb tty;
|
struct sgttyb tty;
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((v& ~0xff)==0) /* Plain character */
|
if ((v& ~0xff)==0) /* Plain character */
|
||||||
putc( (int) v, fp);
|
putc( (int) v, fp);
|
||||||
else
|
else
|
||||||
if (v==C_F_TEXT) {
|
if (v==C_F_TEXT) {
|
||||||
#ifdef __USG
|
|
||||||
ioctl(fileno(fp), TCGETA, &tty);
|
|
||||||
tty.c_oflag |= (ONLCR);
|
|
||||||
tty.c_iflag |= (ICRNL);
|
|
||||||
tty.c_cc[VMIN] = 1;
|
|
||||||
tty.c_cc[VTIME] = 0;
|
|
||||||
tty.c_lflag |= (ECHO|ICANON);
|
|
||||||
ioctl(fileno(fp), TCSETA, &tty);
|
|
||||||
#else
|
|
||||||
gtty(fileno(fp), &tty);
|
gtty(fileno(fp), &tty);
|
||||||
tty.sg_flags&= ~CBREAK;
|
tty.sg_flags&= ~CBREAK;
|
||||||
tty.sg_flags|= ECHO|CRMOD;
|
tty.sg_flags|= ECHO|CRMOD;
|
||||||
stty(fileno(fp), &tty);
|
stty(fileno(fp), &tty);
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
if (v==C_F_RAW) {
|
if (v==C_F_RAW) {
|
||||||
#ifdef __USG
|
|
||||||
ioctl(fileno(fp), TCGETA, &tty);
|
|
||||||
tty.c_oflag &= ~(ONLCR);
|
|
||||||
tty.c_iflag &= ~(ICRNL);
|
|
||||||
tty.c_cc[VMIN] = 1;
|
|
||||||
tty.c_cc[VTIME] = 0;
|
|
||||||
tty.c_lflag &= ~(ECHO|ICANON);
|
|
||||||
ioctl(fileno(fp), TCSETA, &tty);
|
|
||||||
#else
|
|
||||||
gtty(fileno(fp),&tty);
|
gtty(fileno(fp),&tty);
|
||||||
tty.sg_flags|= CBREAK;
|
tty.sg_flags|= CBREAK;
|
||||||
tty.sg_flags&= ~(ECHO|CRMOD);
|
tty.sg_flags&= ~(ECHO|CRMOD);
|
||||||
stty(fileno(fp), &tty);
|
stty(fileno(fp), &tty);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case C_T_CHAN:
|
case C_T_CHAN:
|
||||||
|
@ -121,12 +92,7 @@ static int timeout();
|
||||||
int chan_any(c) register chan *c;
|
int chan_any(c) register chan *c;
|
||||||
{
|
{
|
||||||
#ifdef __BSD4_2
|
#ifdef __BSD4_2
|
||||||
/* Sigh ... since SunOs 4.1, fcntl.h requires sys/types.h. */
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifndef O_NDELAY
|
|
||||||
#define O_NDELAY FNDELAY
|
|
||||||
#endif
|
|
||||||
int flags;
|
int flags;
|
||||||
#endif
|
#endif
|
||||||
switch (c->type) {
|
switch (c->type) {
|
||||||
|
|
Loading…
Reference in a new issue