1: /*
   2:  *	SCCS id	@(#)sys.c	2.1 (Berkeley)	8/5/83
   3:  */
   4: 
   5: /*
   6:  *	indirect driver for controlling tty.
   7:  */
   8: #include "param.h"
   9: #include <sys/conf.h>
  10: #include <sys/dir.h>
  11: #include <sys/user.h>
  12: #include <sys/tty.h>
  13: #include <sys/proc.h>
  14: 
  15: 
  16: syopen(dev, flag)
  17: dev_t dev;
  18: {
  19:     if(u.u_ttyp == NULL) {
  20:         u.u_error = ENXIO;
  21:         return;
  22:     }
  23:     (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag);
  24: }
  25: 
  26: syread(dev)
  27: dev_t dev;
  28: {
  29: #ifdef  UCB_NET
  30:     if (u.u_ttyp == NULL) {
  31:         u.u_error = ENXIO;
  32:         return;
  33:     }
  34: #endif
  35:     (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd);
  36: }
  37: 
  38: sywrite(dev)
  39: dev_t dev;
  40: {
  41: #ifdef  UCB_NET
  42:     if (u.u_ttyp == NULL) {
  43:         u.u_error = ENXIO;
  44:         return;
  45:     }
  46: #endif
  47:     (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd);
  48: }
  49: 
  50: sysioctl(dev, cmd, addr, flag)
  51: dev_t dev;
  52: caddr_t addr;
  53: {
  54: #ifdef  UCB_NET
  55:     if (cmd == TIOCNOTTY) {
  56:         u.u_ttyp = 0;
  57:         u.u_ttyd = 0;
  58:         u.u_procp->p_pgrp = 0;
  59:         return;
  60:     }
  61:     if (u.u_ttyp == NULL) {
  62:         u.u_error = ENXIO;
  63:         return;
  64:     }
  65: #endif
  66:     (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag);
  67: }
  68: 
  69: #ifdef  UCB_NET
  70: syselect(dev, flag)
  71: {
  72:     if (u.u_ttyp == NULL) {
  73:         u.u_error = ENXIO;
  74:         return (0);
  75:     }
  76:     return ((*cdevsw[major(u.u_ttyd)].d_select)(u.u_ttyd, flag));
  77: }
  78: #endif

Defined functions

syopen defined in line 16; used 4 times
syread defined in line 26; used 4 times
syselect defined in line 70; never used
sysioctl defined in line 50; used 4 times
sywrite defined in line 38; used 4 times
Last modified: 1984-02-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 841
Valid CSS Valid XHTML 1.0 Strict