(ULONG *) data, sizeof(struct winsize), &len,
(ULONG *) data, sizeof(TTYSIZE_STRUCT), &len,
ptioctl(int fd, int func, void *data){    APIRET rc;    ULONG len;    struct pt_termios pt;    struct termio *t;    int i;    switch (func) {    case TCGETA:	rc = DosDevIOCtl(fd, XFREE86_PTY, func,			 NULL, 0, NULL,			 (ULONG *) & pt, sizeof(struct pt_termios), &len);	if (rc)	    return -1;	t = (struct termio *) data;	t->c_iflag = pt.c_iflag;	t->c_oflag = pt.c_oflag;	t->c_cflag = pt.c_cflag;	t->c_lflag = pt.c_lflag;	for (i = 0; i < NCC; i++)	    t->c_cc[i] = pt.c_cc[i];	return 0;    case TCSETA:    case TCSETAW:    case TCSETAF:	t = (struct termio *) data;	pt.c_iflag = t->c_iflag;	pt.c_oflag = t->c_oflag;	pt.c_cflag = t->c_cflag;	pt.c_lflag = t->c_lflag;	for (i = 0; i < NCC; i++)	    pt.c_cc[i] = t->c_cc[i];	if (func == TCSETA)	    i = XTY_TIOCSETA;	else if (func == TCSETAW)	    i = XTY_TIOCSETAW;	else	    i = XTY_TIOCSETAF;	rc = DosDevIOCtl(fd, XFREE86_PTY, i,			 (ULONG *) & pt, sizeof(struct pt_termios), &len,			 NULL, 0, NULL);	return (rc) ? -1 : 0;    case TIOCCONS:	return DosDevIOCtl(fd, XFREE86_PTY, XTY_TIOCCONS,			   (ULONG *) data, sizeof(ULONG), &len,			   NULL, 0, NULL);    case TIOCSWINSZ:	return DosDevIOCtl(fd, XFREE86_PTY, XTY_TIOCSWINSZ,			   (ULONG *) data, sizeof(struct winsize), &len,			   NULL, 0, NULL);    case TIOCGWINSZ:	return DosDevIOCtl(fd, XFREE86_PTY, XTY_TIOCGWINSZ,			   NULL, 0, NULL,			   (ULONG *) data, sizeof(struct winsize), &len);    case XTY_ENADUP:	i = 1;	return DosDevIOCtl(fd, XFREE86_PTY, XTY_ENADUP,			   (ULONG *) & i, sizeof(ULONG), &len,			   NULL, 0, NULL);    case XTY_TRACE:	i = 2;	return DosDevIOCtl(fd, XFREE86_PTY, XTY_TRACE,			   (ULONG *) & i, sizeof(ULONG), &len,			   NULL, 0, NULL);    case PTMS_GETPTY:	i = 1;	return DosDevIOCtl(fd, XFREE86_PTY, PTMS_GETPTY,			   (ULONG *) & i, sizeof(ULONG), &len,			   (UCHAR *) data, 14, &len);    default:	return -1;    }}