1*8591Sroot /* tty_tty.c 4.13 82/10/17 */ 235Sbill 335Sbill /* 43117Swnj * Indirect driver for controlling tty. 54487Swnj * 64487Swnj * THIS IS GARBAGE: MUST SOON BE DONE WITH struct inode * IN PROC TABLE. 735Sbill */ 835Sbill #include "../h/param.h" 935Sbill #include "../h/systm.h" 1035Sbill #include "../h/conf.h" 1135Sbill #include "../h/dir.h" 1235Sbill #include "../h/user.h" 1335Sbill #include "../h/tty.h" 1435Sbill #include "../h/proc.h" 157824Sroot #include "../h/uio.h" 1635Sbill 1735Sbill /*ARGSUSED*/ 1835Sbill syopen(dev, flag) 198558Sroot dev_t dev; 208558Sroot int flag; 2135Sbill { 2235Sbill 238558Sroot if (u.u_ttyp == NULL) 248558Sroot return (ENXIO); 258558Sroot return ((*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag)); 2635Sbill } 2735Sbill 2835Sbill /*ARGSUSED*/ 297824Sroot syread(dev, uio) 307824Sroot dev_t dev; 317824Sroot struct uio *uio; 3235Sbill { 3335Sbill 348522Sroot if (u.u_ttyp == NULL) 358522Sroot return (ENXIO); 368522Sroot return ((*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd, uio)); 3735Sbill } 3835Sbill 3935Sbill /*ARGSUSED*/ 407824Sroot sywrite(dev, uio) 417824Sroot dev_t dev; 427824Sroot struct uio *uio; 4335Sbill { 4435Sbill 458522Sroot if (u.u_ttyp == NULL) 468522Sroot return (ENXIO); 478522Sroot return ((*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd, uio)); 4835Sbill } 4935Sbill 5035Sbill /*ARGSUSED*/ 5135Sbill syioctl(dev, cmd, addr, flag) 525618Sroot dev_t dev; 535618Sroot int cmd; 545618Sroot caddr_t addr; 555618Sroot int flag; 5635Sbill { 5735Sbill 585390Swnj if (cmd == TIOCNOTTY) { 595390Swnj u.u_ttyp = 0; 605390Swnj u.u_ttyd = 0; 615390Swnj u.u_procp->p_pgrp = 0; 628558Sroot return (0); 635390Swnj } 648558Sroot if (u.u_ttyp == NULL) 658558Sroot return (ENXIO); 668558Sroot return ((*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag)); 6735Sbill } 684487Swnj 69*8591Sroot /*ARGSUSED*/ 704487Swnj syselect(dev, flag) 71*8591Sroot dev_t dev; 72*8591Sroot int flag; 734487Swnj { 744487Swnj 755576Swnj if (u.u_ttyp == NULL) { 764487Swnj u.u_error = ENXIO; 775390Swnj return (0); 784487Swnj } 796385Swnj return ((*cdevsw[major(u.u_ttyd)].d_select)(u.u_ttyd, flag)); 804487Swnj } 81