Unix V6 /usr/sys/dmr/sys.c

/*
 *	indirect driver for controlling tty.
 */
#include "../param.h"
#include "../conf.h"
#include "../user.h"
#include "../tty.h"
#include "../proc.h"
 
syopen(dev, flag)
{
	register *tp;
 
	if(tp = syttyp())
	(*cdevsw[tp->t_dev.d_major].d_open)(tp->t_dev, flag);
}
 
syread(dev)
{
	register *tp;
 
	if(tp = syttyp())
	(*cdevsw[tp->t_dev.d_major].d_read)(tp->t_dev);
}
 
sywrite(dev)
{
	register *tp;
 
	if(tp = syttyp())
	(*cdevsw[tp->t_dev.d_major].d_write)(tp->t_dev);
}
 
sysgtty(dev, flag)
{
	register *tp;
 
	if(tp = syttyp())
	(*cdevsw[tp->t_dev.d_major].d_sgtty)(tp->t_dev, flag);
}
 
syttyp()
{
	register tp;
 
	tp = u.u_procp->p_ttyp;
	if(tp == NULL)
		u.u_error = ENXIO;
	return(tp);
}
 
unix-history/unix-v6/usr/sys/dmr/sys.c.txt · Последние изменения: 2006/07/26 07:34
 
Copyright (C) 1996-2013 Serge Vakulenko
serge@vak.ru