_chan.c
102,103c98,104
< static long ilbuf;
< static long lbuf;
---
> #ifdef HP_PA
> static struct sgttyb ilbuf;
> static struct sgttyb lbuf;
> #else
> static int ilbuf;
> static int lbuf;
> #endif
107a109,187
> 
> #ifdef HP_PA
> /* ===================================================================== */
> /* ==== das folgende fuer die HP_PA 700: */
> #include <sys/bsdtty.h>
> #include <sys/termio.h>
> 
> #ifdef _HPUX_SOURCE
> 
> /* Die folgenden Nachbildungen der 3 Fkten aus dem "Gopher": */
> /* Nachbilden von getrusage: */
> #include <sys/syscall.h>
> #define getrusage(a, b)  syscall(SYS_GETRUSAGE, a, b)
> 
> /* Nachbilden von getdtablesize: */
> #include <unistd.h>
> 
> int getdtablesize ()
> {
> 	return(sysconf(_SC_OPEN_MAX));
> }
> 
> /* Nachbilden von flock: */
> 
> /* s.o.! #include <unistd.h> */
> #include <sys/file.h>
> #include <errno.h>
> 
> #define LOCK_SH 1
> #define LOCK_EX 2
> #define LOCK_NB 4
> #define LOCK_UN 8
> 
> extern int errno;
> 
> int flock (fd, operation)
> int fd;
> int operation;
> {
> 	int i;
> 
> 	switch (operation) {
> 
> 	/* LOCK_SH - get a shared lock */
> 	case LOCK_SH:
> 	/* LOCK_EX - get an exclusive lock */
> 	case LOCK_EX:
> 		i = lockf (fd, F_LOCK, 0);
> 		break;
> 
> 	/* LOCK_SH|LOCK_NB - get a non-blocking shared lock */
> 	case LOCK_SH|LOCK_NB:
> 	/* LOCK_EX|LOCK_NB - get a non-blocking exclusive lock */
> 	case LOCK_EX|LOCK_NB:
> 		i = lockf (fd, F_TLOCK, 0);
> 		if (i == -1)
> 			if ((errno == EAGAIN) || (errno == EACCES))
> 				errno = EWOULDBLOCK;
> 		break;
> 
> 	/* LOCK_UN - unlock */
> 	case LOCK_UN:
> 		i = lockf (fd, F_ULOCK, 0);
> 		break;
> 
> 	/* Default - can't decipher operation */
> 	default:
> 		i = -1;
> 		errno = EINVAL;
> 		break;
> 	}
> 
> 	return (i);
> }
> 
> #endif
> /* ===================================================================== */
> #endif
> 
127a208,212
> #ifdef HP_PA
> /* ==== */
> struct termio termbuf;
> /* ==== */
> #endif
176c261,262
< 			obuf.sg_flags |= CBREAK + CRMOD;
---
> 			obuf.sg_flags |= RAW;
> 			obuf.sg_flags |= /*==== CBREAK +*/ CRMOD;
185a272,285
> /* ==== */
> 	err = ioctl(fd, TCGETA, &termbuf);
> 	if (err == 0) {
> 		termbuf.c_iflag |= ICRNL + IXON;
> 		termbuf.c_oflag |= OPOST;
> 		termbuf.c_cflag |= PARENB;
> 		err = ioctl(fd, TCSETA, &termbuf);
> 		if (err != 0) {
> 			close(fd);
> 			elist[0] = _unix_erstr(errno);
> 			signal(ERR_not_possible);
> 			}
> 		}
> /* ==== */
210a311,313
> /* ==== */
> struct termio termbuf;
> /* ==== */
247c350,351
< 			obuf.sg_flags |= CBREAK + CRMOD;
---
> 			obuf.sg_flags |= RAW;
> 			obuf.sg_flags |= /*====CBREAK +*/ CRMOD;
256a361,374
> /* ==== */
> 	err = ioctl(fd, TCGETA, &termbuf);
> 	if (err == 0) {
> 		termbuf.c_iflag |= ICRNL + IXON;
> 		termbuf.c_oflag |= OPOST;
> 		termbuf.c_cflag |= PARENB;
> 		err = ioctl(fd, TCSETA, &termbuf);
> 		if (err != 0) {
> 			close(fd);
> 			elist[0] = _unix_erstr(errno);
> 			signal(ERR_not_possible);
> 			}
> 		}
> /* ==== */
551,552c672
< errcode _chanOP_save_tty(opt)
< bool opt;
---
> errcode _chanOP_save_tty()
555,561d674
< int zcnt = 0;
< 	/* 
< 	   added the following cbreak so that ctrl-c would not hang the shell
< 	   when running pclu from a makefile and using tcsh or sh.
< 	   sh still needs a reset.
< 	   8/5/92 dcurtis
< 	*/
565d677
< 		if (opt) sbuf.sg_flags |= CBREAK;
569,570d680
< 		printf("\n");
< 		/* err = ioctl(0, TIOCFLUSH, zcnt); */
598a709,711
> /* ==== */
> struct termio termbuf;
> /* ==== */
632c745,746
< 	tbuf.sg_flags |= CBREAK + CRMOD;
---
> 	tbuf.sg_flags |= RAW;
> 	tbuf.sg_flags |= /*==== CBREAK +*/ CRMOD;
636a751,760
> /* ==== */
> 	err = ioctl(0, TCGETA, &termbuf);
> 	if (err == 0) {
> 		termbuf.c_iflag |= ICRNL+ IXON;
> 		termbuf.c_oflag |= OPOST;
> 		termbuf.c_cflag |= PARENB;
> 		err = ioctl(0, TCSETA, &termbuf);
> 		if (err != 0) { goto unix_err_hdlr; }
> 		}
> /* ==== */
661a786
> 
680c805
< 	_chanOP_save_tty(true);
---
> 	_chanOP_save_tty();
707c832
< 	_chanOP_save_tty(true);
---
> 	_chanOP_save_tty();
727c852
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT); */
741c866
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT); */
762c887
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);*/
776c901
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);*/
797c922
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);*/
812c937
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);*/
837c962
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT); */
853c978
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);
---
> /*	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT); */
879c1004
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIS, LLITOUT); */
895c1020
< 	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT);
---
> /* ====	if (lit) result = ioctl(ch->wr.num, TIOCLBIC, LLITOUT); */
1009c1134
< 	if (lit) result = ioctl(fd, TIOCLBIS, LLITOUT);
---
> /* ====	if (lit) result = ioctl(fd, TIOCLBIS, LLITOUT); */
1023c1148
< 	if (lit) result = ioctl(fd, TIOCLBIC, LLITOUT);
---
> /* ====	if (lit) result = ioctl(fd, TIOCLBIC, LLITOUT); */
1159d1283
< 
1174c1298,1302
< 	result = ioctl(s, TIOCOUTQ, &obuf);
---
> /*====	result = ioctl(s, TIOCOUTQ, &obuf); */
> /* Modifikation (Puffer flush'en und 0 zurueck): */
>         result = ioctl(s, TCFLSH, 1);
>         result = 0;
> /* Ende Modifikation */

