DPRINTF(("Unknown svr4 ttold %x\n", cmd));
DPRINTF(("Unknown svr4 ttold %lx\n", cmd));
svr4_ttoldioctl(fp, cmd, data, p, retval)	struct file *fp;	u_long cmd;	caddr_t data;	struct proc *p;	register_t *retval;{	int			error;	int (*ctl) __P((struct file *, u_long,  caddr_t, struct proc *)) =			fp->f_ops->fo_ioctl;	*retval = 0;	switch (cmd) {	case SVR4_TIOCGPGRP:		{			pid_t pid;			if ((error = (*ctl)(fp, TIOCGPGRP,					    (caddr_t) &pid, p)) != 0)			    return error;			DPRINTF(("TIOCGPGRP %d", pid));			if ((error = copyout(&pid, data, sizeof(pid))) != 0)				return error;		}	case SVR4_TIOCSPGRP:		{			pid_t pid;			if ((error = copyin(data, &pid, sizeof(pid))) != 0)				return error;			DPRINTF(("TIOCSPGRP %d", pid));			return (*ctl)(fp, TIOCSPGRP, (caddr_t) &pid, p);		}	case SVR4_TIOCGSID:		{			pid_t pid;			if ((error = (*ctl)(fp, TIOCGSID,					    (caddr_t) &pid, p)) != 0)				return error;			DPRINTF(("TIOCGSID %d", pid));			return copyout(&pid, data, sizeof(pid));		}	case SVR4_TIOCGETP:		{			struct sgttyb bs;			struct svr4_sgttyb ss;			error = (*ctl)(fp, TIOCGETP, (caddr_t) &bs, p);			if (error)				return error;			bsd_sgttyb_to_svr4_sgttyb(&bs, &ss);			return copyout(&ss, data, sizeof(ss));		}	case SVR4_TIOCSETP:	case SVR4_TIOCSETN:		{			struct sgttyb bs;			struct svr4_sgttyb ss;			if ((error = copyin(data, &ss, sizeof(ss))) != 0)				return error;			svr4_sgttyb_to_bsd_sgttyb(&ss, &bs);			cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN;			return (*ctl)(fp, cmd, (caddr_t) &bs, p);		}	case SVR4_TIOCGETC:		{			struct tchars bt;			struct svr4_tchars st;			error = (*ctl)(fp, TIOCGETC, (caddr_t) &bt, p);			if (error)				return error;			bsd_tchars_to_svr4_tchars(&bt, &st);			return copyout(&st, data, sizeof(st));		}	case SVR4_TIOCSETC:		{			struct tchars bt;			struct svr4_tchars st;			if ((error = copyin(data, &st, sizeof(st))) != 0)				return error;			svr4_tchars_to_bsd_tchars(&st, &bt);			return (*ctl)(fp, TIOCSETC, (caddr_t) &bt, p);		}	case SVR4_TIOCGLTC:		{			struct ltchars bl;			struct svr4_ltchars sl;			error = (*ctl)(fp, TIOCGLTC, (caddr_t) &bl, p);			if (error)				return error;			bsd_ltchars_to_svr4_ltchars(&bl, &sl);			return copyout(&sl, data, sizeof(sl));		}	case SVR4_TIOCSLTC:		{			struct ltchars bl;			struct svr4_ltchars sl;			if ((error = copyin(data, &sl, sizeof(sl))) != 0)				return error;			svr4_ltchars_to_bsd_ltchars(&sl, &bl);			return (*ctl)(fp, TIOCSLTC, (caddr_t) &bl, p);		}	default:		DPRINTF(("Unknown svr4 ttold %x\n", cmd));		return 0;	/* ENOSYS really */	}}