7 static char *
rcsid=
"@(#)$Id$";
9 #include <sys/termios.h> 10 #include <sys/ioctl.h> 26 {
if (isint(x))
return(
intval(x));
28 else if (pisiostream(x)) x=x->c.iostream.in;
30 return(
intval(x->c.fstream.fd));}
42 unsigned long ctlcode;
55 unsigned long ctlcode;
61 intarg=ckintval(argv[1]);
62 stat=ioctl(fd,ctlcode, &intarg);
176 #if sun3 || sun4 || Linux || alpha || IRIX || Solaris2 182 {
return(
ioctl_struct(
n,argv,TCGETS,
sizeof(
struct termios)));}
188 {
return(
ioctl_struct(
n,argv,TCSETS,
sizeof(
struct termios)));}
194 {
return(
ioctl_struct(
n,argv,TCSETSW,
sizeof(
struct termios)));}
200 {
return(
ioctl_struct(
n,argv,TCSETSF,
sizeof(
struct termios)));}
207 {
return(
ioctl_struct(
n,argv,TCGETA,
sizeof(
struct termio)));}
213 {
return(
ioctl_struct(
n,argv,TCSETA,
sizeof(
struct termio)));}
219 {
return(
ioctl_struct(
n,argv,TCSETAF,
sizeof(
struct termio)));}
224 {
return(
ioctl_struct(
n,argv,TCSETAW,
sizeof(
struct termio)));}
234 buf=
getbuf(
n,argv[1],
sizeof(
struct termios));
235 stat=tcgetattr(
getfd(argv[0]),(
struct termios *)buf->
c.
str.
chars);
245 buf=
getbuf(
n,argv[2],
sizeof(
struct termios));
246 if (
n>=2) optact=ckintval(argv[1]);
247 stat=tcsetattr(
getfd(argv[0]),optact,(
struct termios *)buf->
c.
str.
chars);
278 #if sun3 || sun4 || Linux || alpha || IRIX || Solaris2 pointer TCSETATTR(context *ctx, int n, argv)
pointer IOCTL_TCSETSW(context *ctx, int n, argv)
pointer IOCTL_TCSETS(context *ctx, int n, argv)
static pointer ioctl_int(int n, argv, unsigned long ctlcode)
pointer defunpkg(context *, char *, pointer, pointer(*)(), pointer)
static pointer getbuf(int n, pointer x, int bufsize)
pointer IOCTL_TCSETSF(context *ctx, int n, argv)
static int getfd(pointer x)
static pointer ioctl_struct(int n, argv, unsigned long ctlcode, int bufsize)
pointer IOCTL_TCGETA(context *ctx, int n, argv)
pointer IOCTL_TCSETAF(context *ctx, int n, argv)
void eusioctl(context *ctx, pointer mod)
pointer IOCTL_TCGETS(context *ctx, int n, argv)
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
pointer IOCTL_TCSETAW(int n, argv)
static char buf[CHAR_SIZE]
pointer IOCTL_TCSETA(context *ctx, int n, argv)
pointer TCGETATTR(context *ctx, int n, argv)